import type { ColorName } from '../color';
import type { DamageEffectName } from '../damage';
import type { GameType } from '../game';
import type { GameTrack } from '../gameTrack';
import type { KartHardwareState } from '../hardware';
import type { PowerUpName } from '../powerUp';
import type { KartShield } from './KartShield';
import type { KartStatus } from './KartStatus';

interface KartGame {
  id: number;
  type: GameType;
}

export interface Kart {
  /** Unique ID by kart */
  guid: string;
  /** kartGuid assigned by Game Track (multiple karts could have the same Id) */
  id: number;
  mac: string;
  hostname: string;
  isConnected: boolean;
  status: KartStatus;
  shield: KartShield;
  // If a Kart is not assigned to a game, the default game track should be "TEST"
  gameTrackId: GameTrack['id'];
  color: ColorName;
  number: number;
  currentGame?: KartGame | null;
  description?: string | null;
  /**
   * In testing Mode, the kart should be listening to the hardware status
   */
  isSubscribedToHardwareStatus: boolean;
  hardwareState?: KartHardwareState | null;
  currentPowerUp?: PowerUpName | null;
  currentDamage?: DamageEffectName | null;
}
