import 'package:wolf_3d_data_types/wolf_3d_data_types.dart';
import 'package:wolf_3d_engine/wolf_3d_engine.dart';
import 'package:wolf_3d_flutter/wolf_3d.dart';

class FlutterAudioAdapter implements EngineAudio {
  @override
  void playLevelMusic(WolfLevel level) {
    Wolf3d.I.audio.playLevelMusic(level);
  }

  @override
  void stopMusic() {
    Wolf3d.I.audio.stopMusic();
  }

  @override
  void playSoundEffect(int sfxId) {
    Wolf3d.I.audio.playSoundEffect(sfxId);
  }

  @override
  void playMenuMusic() {
    Wolf3d.I.audio.playMenuMusic();
  }

  @override
  Future<void> init() async {
    await Wolf3d.I.audio.init();
  }

  @override
  void dispose() {
    Wolf3d.I.audio.dispose();
  }

  @override
  WolfensteinData? get activeGame => Wolf3d.I.activeGame;

  @override
  set activeGame(WolfensteinData? value) {
    if (value != null) {
      Wolf3d.I.setActiveGame(value);
    }
  }
}
