private void CheckFreeMovingToBonus(BonusIDType bonusID)
        {
            var availInBonus = _income.BonusRestrictions[bonusID] - _armiesUsedOnBonuses.ValueOrZero(bonusID);

            Assert.Fatal(availInBonus > 0, "CheckFreeMovingToBonus called with 0 armies available to move");

            foreach (var terrID in _map.Bonuses[bonusID].Territories)
            {
                var free = _freeArmiesUsedOn.ValueOrZero(terrID);

                if (free > 0)
                {
                    var toMove = Math.Min(free, availInBonus);

                    _freeArmiesUsedOn.AddTo(terrID, -toMove);
                    _armiesUsedOnBonuses.AddTo(bonusID, toMove);
                    availInBonus -= toMove;

                    if (availInBonus == 0)
                    {
                        return;
                    }
                }
            }
        }
示例#2
0
 public BonusDetails(MapDetails parent, BonusIDType id, int armiesReward)
 {
     this.Parent      = parent;
     this.ID          = id;
     this.Amount      = armiesReward;
     this.Territories = new List <TerritoryIDType>();
 }
 internal PlayerIncomeProgress(BonusIDType bonusID, int deployed, int totalToDeploy)
 {
     this.Restriction   = bonusID;
     this.Deployed      = deployed;
     this.TotalToDeploy = totalToDeploy;
 }
        public static GameOrderPlayCardSurveillance Create(CardInstanceIDType cardInstanceID, PlayerIDType playerID, BonusIDType targetBonus)
        {
            var o = new GameOrderPlayCardSurveillance();

            o.CardInstanceID = cardInstanceID;
            o.PlayerID       = playerID;
            o.TargetBonus    = targetBonus;
            return(o);
        }
示例#5
0
 public int ArmiesDeployedToBonus(BonusIDType bonusID)
 {
     return(_armiesUsedOnBonuses.ValueOrZero(bonusID));
 }