import 'package:wolf_3d_dart/wolf_3d_engine.dart';
import 'package:wolf_3d_dart/wolf_3d_entities.dart';

abstract class Wolf3dInput {
  bool isMovingForward = false;
  bool isMovingBackward = false;
  bool isTurningLeft = false;
  bool isTurningRight = false;
  bool isInteracting = false;
  bool isBack = false;
  double? menuTapX;
  double? menuTapY;
  bool isFiring = false;
  WeaponType? requestedWeapon;

  /// Called once per frame by the game loop to refresh the state.
  void update();

  /// Exports the current state as a clean DTO for the engine.
  /// Subclasses do not need to override this.
  EngineInput get currentInput => EngineInput(
    isMovingForward: isMovingForward,
    isMovingBackward: isMovingBackward,
    isTurningLeft: isTurningLeft,
    isTurningRight: isTurningRight,
    isFiring: isFiring,
    isInteracting: isInteracting,
    isBack: isBack,
    menuTapX: menuTapX,
    menuTapY: menuTapY,
    requestedWeapon: requestedWeapon,
  );
}

enum WolfInputAction {
  forward,
  backward,
  turnLeft,
  turnRight,
  fire,
  interact,
  back,
  weapon1,
  weapon2,
  weapon3,
  weapon4,
}
