import type {
  BallSensorDiskThrowerModuleCommands,
  DiskSensorBallShooterModuleCommands,
  FlagModuleCommands,
  LeftStarBackLaserModuleCommands,
  RGBModuleCommands,
  RightStarFrontLaserModuleCommands,
  SoundModuleCommands,
  SpeedModuleCommands,
  SteeringWheelModuleCommands,
} from '../command';
import type { Damage } from '../damage';
import type { PowerUpName } from './PowerUpName';
import type { PowerUpShield } from './PowerUpShield';

export type PowerUpLevel = 1 | 2 | 3 | 4 | 5;

/**
 * The Power-up command exclude the ScreenModuleCommands because
 * the system needs to know to know in which kind of game is the kart.
 */
export type PowerUpCommand =
  | BallSensorDiskThrowerModuleCommands
  | DiskSensorBallShooterModuleCommands
  | FlagModuleCommands
  | RGBModuleCommands
  | SpeedModuleCommands
  | LeftStarBackLaserModuleCommands
  | RightStarFrontLaserModuleCommands
  | SteeringWheelModuleCommands
  | SoundModuleCommands;

export interface PowerUp {
  id: string;
  name: PowerUpName;
  imageName: string;
  description: string;
  level: PowerUpLevel;

  /** Commands to be executed when the power-up is assigned */
  assignationCommands: PowerUpCommand[];
  /** Whenever the user activates the assigned power-up */
  activationCommands: PowerUpCommand[];
  shield?: PowerUpShield;
  /**
   * Represents damage that needs the backend to be propagated
   * to other(s) kart(s)
   */
  networkDamage?: Damage;
}
