void UpdateChallenge(ref ChallengeModel model) { if (model.Completed) { return; } switch (model.Type) { case ChallengeType.PopulationTotal: model.Progress = 0; // TODO break; case ChallengeType.PowerOutput: model.Progress = Mathf.Min(PlayerBuildingManager.GetTotalPowerOutput(), model.Target); break; case ChallengeType.TotalCash: model.Progress = Mathf.Min(FundManager.Funds, model.Target); break; } if (model.Completed) { EventSystem.Publish(new ChallengeCompletedEvent(model)); } }
private static int CalculateTotalPollution() { int pollution = 0; pollution += PlayerBuildingManager.GetTotalPollution(); return(pollution); }
private void Update() { if (LevelStateManager.LevelFinished || LevelStateManager.Paused) { return; } float powerOutput = PlayerBuildingManager.GetTotalPowerOutput(); float powerDrain = CityBuildingManager.GetTotalDrain(); PowerText.text = powerOutput.ToString(); DrainText.text = powerDrain.ToString(); if (powerDrain == 0) { PowerFlowBar.Value = HALF_STANDARD_DEVIATION; } else { float totalPower = powerOutput - powerDrain; PowerFlowBar.Value = totalPower + HALF_STANDARD_DEVIATION; } }
public static int GetCashflow() { return(PlayerBuildingManager.GetTotalMaintenanceCost() * -1 + CityBuildingManager.GetTotalIncome()); }