remove playerconfig

This commit is contained in:
evanpelle
2024-08-29 20:24:50 -07:00
parent 0281db46fa
commit d2a8b48764
10 changed files with 17 additions and 36 deletions
+2 -3
View File
@@ -2,7 +2,6 @@ import {PriorityQueue} from "@datastructures-js/priority-queue";
import {Cell, Execution, MutableGame, MutablePlayer, PlayerID, TerraNullius, Tile} from "../Game";
import {PseudoRandom} from "../PseudoRandom";
import {manhattanDist} from "../Util";
import {Config, PlayerConfig} from "../configuration/Config";
export class AttackExecution implements Execution {
private active: boolean = true;
@@ -79,7 +78,7 @@ export class AttackExecution implements Execution {
return
}
let numTilesPerTick = this.mg.config().player().attackTilesPerTick(this._owner, this.target, this.numTilesWithEnemy)
let numTilesPerTick = this.mg.config().attackTilesPerTick(this._owner, this.target, this.numTilesWithEnemy)
if (this.targetCell != null) {
numTilesPerTick /= 2
}
@@ -114,7 +113,7 @@ export class AttackExecution implements Execution {
badTiles++
continue
}
const {attackerTroopLoss, defenderTroopLoss, tilesPerTickUsed} = this.mg.config().player().attackLogic(this._owner, this.target, tileToConquer)
const {attackerTroopLoss, defenderTroopLoss, tilesPerTickUsed} = this.mg.config().attackLogic(this._owner, this.target, tileToConquer)
numTilesPerTick -= tilesPerTickUsed
this.troops -= attackerTroopLoss
if (this.target.isPlayer()) {
-1
View File
@@ -1,4 +1,3 @@
import {Config, PlayerConfig} from "../configuration/Config";
import {Cell, Execution, MutableGame, MutablePlayer, Player, PlayerID, PlayerInfo, TerraNullius} from "../Game"
import {PseudoRandom} from "../PseudoRandom"
import {simpleHash} from "../Util";
+2 -2
View File
@@ -1,4 +1,4 @@
import {Config, PlayerConfig} from "../configuration/Config"
import {Config} from "../configuration/Config"
import {Execution, MutableGame, MutablePlayer, PlayerID} from "../Game"
export class PlayerExecution implements Execution {
@@ -22,7 +22,7 @@ export class PlayerExecution implements Execution {
if (ticks < this.config.numSpawnPhaseTurns()) {
return
}
this.player.setTroops(this.config.player().troopAdditionRate(this.player))
this.player.setTroops(this.config.troopAdditionRate(this.player))
}
owner(): MutablePlayer {
+1 -2
View File
@@ -1,4 +1,3 @@
import {Config, PlayerConfig} from "../configuration/Config"
import {Cell, Execution, MutableGame, MutablePlayer, PlayerInfo} from "../Game"
import {BotExecution} from "./BotExecution"
import {PlayerExecution} from "./PlayerExecution"
@@ -37,7 +36,7 @@ export class SpawnExecution implements Execution {
return
}
const player = this.mg.addPlayer(this.playerInfo, this.mg.config().player().startTroops(this.playerInfo))
const player = this.mg.addPlayer(this.playerInfo, this.mg.config().startTroops(this.playerInfo))
getSpawnCells(this.mg, this.cell).forEach(c => {
player.conquer(this.mg.tile(c))
})
@@ -1,4 +1,3 @@
import {Config, PlayerConfig} from "../configuration/Config"
import {Execution, MutableGame, MutablePlayer, PlayerID} from "../Game"
import {ClientID} from "../Schemas"