public void EndofTurn() { currentProduction.productionLeft -= productionRate * workforce.GetLaborers(); if (currentProduction.productionLeft <= 0) { if (currentProduction.rocketType == -1) { finances.UpdateFunds((int)(productionRate * workforce.GetLaborers() * 0.2f)); currentProduction.productionLeft = 0; } else { turnManager.ShipConstruction(currentProduction.rocketType); productionOverflow = currentProduction.productionLeft; currentProduction = new CurrentProduction(0, -1); } } }
public void ShipLaunch(GameObject go) { var launch = go.GetComponent <Launch> (); if (launch.GetLaunchCost() > finances.DisplayFunds()) { ErrorTooltip.OpenTooltip("Not enough funds"); return; } finances.UpdateFunds(-launch.GetLaunchCost()); worldPopulation.UpdatePopulation(-launch.GetCapacity()); finances.UpdateIncome(0); Destroy(go); }
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); }