add GameConfig to Game

This commit is contained in:
Evan
2024-12-07 09:45:39 -08:00
parent 60ccf2ba36
commit 2d2df14ae3
16 changed files with 77 additions and 79 deletions
-3
View File
@@ -112,9 +112,6 @@ export class AttackExecution implements Execution {
if (!this.active) {
return
}
if (ticks < this.mg.config().numSpawnPhaseTurns()) {
return
}
const alliance = this._owner.allianceWith(this.target as Player)
if (this.breakAlliance && alliance != null) {
this.breakAlliance = false
-5
View File
@@ -26,11 +26,6 @@ export class BotExecution implements Execution {
}
tick(ticks: number) {
if (ticks < this.mg.config().numSpawnPhaseTurns()) {
return
}
if (!this.bot.isAlive()) {
this.active = false
return
+2 -2
View File
@@ -34,7 +34,7 @@ export class Executor {
// private random = new PseudoRandom(999)
private random: PseudoRandom = null
constructor(private gs: Game, private difficulty: Difficulty, private gameID: GameID, private workerClient: WorkerClient) {
constructor(private gs: Game, private gameID: GameID, private workerClient: WorkerClient) {
// Add one to avoid id collisions with bots.
this.random = new PseudoRandom(simpleHash(gameID) + 1)
}
@@ -127,7 +127,7 @@ export class Executor {
this.random.nextID()
),
nation.cell,
nation.strength * this.difficulty
nation.strength * this.gs.gameConfig().difficulty
))
}
return execs
-4
View File
@@ -28,10 +28,6 @@ export class PlayerExecution implements Execution {
}
tick(ticks: number) {
if (ticks < this.config.numSpawnPhaseTurns()) {
return
}
this.player.units().forEach(u => {
const tileOwner = u.tile().owner()
if (u.info().territoryBound) {