mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-07 05:56:03 +00:00
add GameConfig to Game
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user