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); }
private void RefundCost(ResourceCost cost) { _playerResourceData.AmendGold(cost.Gold); _playerResourceData.AmendTimber(cost.Timber); _playerResourceData.AmendFood(-cost.Food); }