Beispiel #1
0
 public void DropResources(ResourceType type, int amount)
 {
     switch (type)
     {
     default: _resourceData.AmendTimber(amount);
         return;
     }
 }
Beispiel #2
0
        public void DropResources(ResourceType resource, int amount)
        {
            switch (resource)
            {
            case ResourceType.Gold:
                _resourceData.AmendGold(amount);
                break;

            case ResourceType.Timber:
                _resourceData.AmendTimber(amount);
                break;
            }
        }
Beispiel #3
0
        private void BuyAndAddToQueue(ProductionData item)
        {
            ResourceCost cost = item.Cost;

            if (!item.RequirementsMet())
            {
                return;
            }
            bool canBuild = (_building.Queue.Count < 5) && CanBuy(cost);

            if (!canBuild)
            {
                return;
            }
            var dataToAdd = item as IQueueable;

            _building.AddToQueue(dataToAdd);
            _playerResourceData.AmendGold(-cost.Gold);
            _playerResourceData.AmendFood(cost.Food);
            _playerResourceData.AmendTimber(-cost.Timber);
        }
Beispiel #4
0
 private void RefundCost(ResourceCost cost)
 {
     _playerResourceData.AmendGold(cost.Gold);
     _playerResourceData.AmendTimber(cost.Timber);
     _playerResourceData.AmendFood(-cost.Food);
 }