public bool CanAffordTrainerPurchase(IResourceInventory i_inventory) { int cost = GetNextTrainerCost(); bool canTrain = i_inventory.HasEnoughResources(VirtualCurrencies.GOLD, cost); return(canTrain); }
public bool CanAffordUpgrade(IResourceInventory i_inventory) { foreach (KeyValuePair <string, int> cost in mData.ResourcesToUpgrade) { int resourceCost = GetUpgradeCostForResource(cost.Key); if (i_inventory.HasEnoughResources(cost.Key, resourceCost) == false) { return(false); } } return(true); }