Пример #1
0
 private ResourceInstance CalculateCost(WorldBehaviour.TerraformCostCalculation cost)
 {
     if (cost.heightChangedTiles.Count > 0)
     {
         ResourceInstance resources = changeTerrainTileHeightCost;
         resources.amount *= cost.heightChangedTiles.Count;
         return(resources);
     }
     else
     {
         ResourceInstance resources = clearTerrainTileCost;
         resources.amount *= cost.bulldozedTiles.Count;
         return(resources);
     }
 }
Пример #2
0
 public bool CanAfford(ResourceInstance cost)
 {
     return(amount[resources.IndexOf(cost.resource)] >= cost.amount);
 }
Пример #3
0
        public void Pay(ResourceInstance cost)
        {
            amount[resources.IndexOf(cost.resource)] -= cost.amount;

            UpdateResourceDisplay();
        }
Пример #4
0
        public void Add(ResourceInstance item)
        {
            amount[resources.IndexOf(item.resource)] += item.amount;

            UpdateResourceDisplay();
        }