def applyHeuristic(self, game: Game) -> Game: """ the actions taken are: 1. place all bonus army in my city with minimum number of soldiers 2. attack enemy city with minimum number of soldiers that can be attacked """ myCities = game.citiesOf(self.isRedPlayer) myMinArmyCityId = self.minArmyCityId(game, myCities) game.placeBonusSoldiers(myMinArmyCityId, game.bonusSoldiers(self.isRedPlayer)) bestUId, bestVId = self.hisMinArmyCityToAttack(game, myCities) if bestUId != -1 and bestVId != -1: game.move(bestUId, bestVId, game.cityList[bestVId].armyCount + 1) return game
def placeBonusArmy(self, army, city): Game.placeBonusSoldiers(city.id, army)