public BLResource BuyBuilding(String name, BLResource resources) { Building building = GetBuilding(name); foreach (ReqResource req in building.requirements) { resources.GetResource(req.resName).value -= req.value; } IncrementBuildingPrice("Hut"); return resources; }
public Boolean IsRequirementsMetForBuilding(String name, BLResource resources) { Building building = GetBuilding(name); foreach (ReqResource req in building.requirements) { if(req.value > resources.GetResource(req.resName).value) { return false; } } return true; }