import { Game, PlayerType } from "../../game/Game"; import { GameID } from "../../Schemas"; import { SpawnExecution } from "../SpawnExecution"; export class PlayerSpawner { private players: SpawnExecution[] = []; constructor( private gm: Game, private gameID: GameID, ) {} spawnPlayers(): SpawnExecution[] { for (const player of this.gm.allPlayers()) { if (player.type() !== PlayerType.Human) { continue; } this.players.push(new SpawnExecution(this.gameID, player.info())); } return this.players; } }