public bool UpdateLabor(int change) { if (finances.DisplayFunds() < change * laborerHireCost && change > 0) { return(false); } laborers += change; if (change > 0) { finances.UpdateFunds(-change * laborerHireCost); } if (change < 0) { finances.UpdateFunds(-change * laborerHireCost / 2); } finances.UpdateExpenses(change * laborerCost); return(true); }
public Workforce(int l, int r, int pc, int dc, Finances f, WorldPopulation wp) { laborers = l; researchers = r; planningCenters = pc; donationCenters = dc; finances = f; worldPopulation = wp; int expenses = (l * laborerCost) + (r * researcherCost) + (pc * planningCenterCost); finances.UpdateExpenses(expenses); }