示例#1
0
        /// <summary>
        /// Calculates the transfers.
        /// </summary>
        /// <param name="superRegion">The super region.</param>
        public void CalculateTransfers(SuperRegion superRegion)
        {
            bool skipSuperRegion = StrategyManager.SkipSuperRegion(superRegion);

            if (skipSuperRegion)
            {
                return;
            }

            bool transferDone = false;

            bool borderTerritoriesWithEnemyArmies = StrategyManager.EnemyBorderTerritories(superRegion, SuperRegions);
            bool regionsWithEnemyArmies           = StrategyManager.EnemyRegions(superRegion);

            if (!borderTerritoriesWithEnemyArmies && !regionsWithEnemyArmies)
            {
                transferDone = CalculateForNoEnemies(superRegion);
            }

            if (borderTerritoriesWithEnemyArmies && !transferDone)
            {
                transferDone = CalculateForEnemyBorderTerritories(superRegion);
            }

            if (regionsWithEnemyArmies && !transferDone)
            {
                transferDone = CalculateForEnemyRegions(superRegion);
            }

            var stuckArmies = StrategyManager.GetStuckArmies(superRegion, Transfers);

            CalculateForStuckArmies(stuckArmies);
        }