Beispiel #1
0
        private bool IsPreventingUseful(BotMap visibleMap, BotMap movesMap, BotBonus bonus)
        {
            if (bonus.GetOwnedTerritoriesAndNeighbors().Count == 0)
            {
                return(false);
            }

            var mmBonus = movesMap.Bonuses[bonus.ID];

            if (mmBonus.GetOwnedTerritories().Count > 0)
            {
                return(false);
            }
            if (bonus.IsOwnedByAnyOpponent())
            {
                return(false);
            }
            if (bonus.GetOwnedNeighborTerritories().Count == 0)
            {
                return(false);
            }
            if (bonus.Amount < 2)
            {
                return(false);
            }
            if (bonus.NeutralArmies.DefensePower > 4)
            {
                return(false);
            }
            foreach (var neutralTerritory in bonus.NeutralTerritories)
            {
                if (neutralTerritory.GetOpponentNeighbors().Count == 0)
                {
                    return(false);
                }
            }

            return(true);
        }