Exemplo n.º 1
0
        private void AddBorderTerritoryDeployment(MultiMoves movesSoFar, int availableDeployment)
        {
            TerritoryStanding territoryToDeployTo = MapInformer.GetOwnedBorderTerritories(movesSoFar.GetTerritoryStandingsAfterAllMoves(), GameState.MyPlayerId).FirstOrDefault();

            if (territoryToDeployTo == null)
            {
                territoryToDeployTo = MapInformer.GetOwnedTerritories(GameState.CurrentTurn().LatestTurnStanding.Territories.Values.ToList(), GameState.MyPlayerId).First();
            }
            movesSoFar.AddDeployOrder(GameOrderDeploy.Create(GameState.MyPlayerId, availableDeployment, territoryToDeployTo.ID, REASON));
        }
Exemplo n.º 2
0
        private void PumpBiggestAttack(MultiMoves movesSoFar, GameOrderAttackTransfer biggestAttack, int availableDeployment)
        {
            if (availableDeployment == 0)
            {
                return;
            }
            movesSoFar.AddDeployOrder(GameOrderDeploy.Create(GameState.MyPlayerId, availableDeployment, biggestAttack.From, REASON));
            var  endAttack = biggestAttack;
            bool foundStep = true;

            while (foundStep)
            {
                foundStep = false;
                // probably endless loop possible as soon as we add transfer moves back to attacking territory
                var nextAttack = movesSoFar.AttackMoves.Where(a => a.From == endAttack.To).FirstOrDefault();
                if (nextAttack != null)
                {
                    endAttack = nextAttack;
                    foundStep = true;
                }
            }
            movesSoFar.PumpArmies(endAttack.To, availableDeployment, REASON);
        }