public void Gather(ResourceType type, float amount) { ResourceValue resource = resolveType(type); if (resource.CanGather(amount)) { resource.Gather(amount); } }
public bool CanAfford(ObjectDefinition definition) { return(minerals.CanSpend(definition.CostMinerals) && gas.CanSpend(definition.CostGas) && supplies.CanGather(definition.CostSupplies)); }