game start delay 5 seconds

This commit is contained in:
evanpelle
2024-08-16 20:42:10 -07:00
parent 1cf112c0fb
commit bc8463fa79
12 changed files with 54 additions and 39 deletions
+5 -5
View File
@@ -1,4 +1,4 @@
import {PlayerConfig} from "../configuration/Config"
import {Config, PlayerConfig} from "../configuration/Config"
import {Cell, Execution, MutableGame, MutablePlayer, PlayerInfo} from "../Game"
import {BotExecution} from "./BotExecution"
import {PlayerExecution} from "./PlayerExecution"
@@ -12,7 +12,7 @@ export class SpawnExecution implements Execution {
constructor(
private playerInfo: PlayerInfo,
private cell: Cell,
private playerConfig: PlayerConfig
private config: Config
) { }
@@ -24,13 +24,13 @@ export class SpawnExecution implements Execution {
if (!this.isActive()) {
return
}
const player = this.gs.addPlayer(this.playerInfo, this.playerConfig.startTroops(this.playerInfo))
const player = this.gs.addPlayer(this.playerInfo, this.config.player().startTroops(this.playerInfo))
getSpawnCells(this.gs, this.cell).forEach(c => {
player.conquer(this.gs.tile(c))
})
this.gs.addExecution(new PlayerExecution(player.id(), this.playerConfig))
this.gs.addExecution(new PlayerExecution(player.id(), this.config))
if (player.info().isBot) {
this.gs.addExecution(new BotExecution(player, this.playerConfig))
this.gs.addExecution(new BotExecution(player, this.config))
}
this.active = false
}