예제 #1
0
        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));
            }
        }
예제 #2
0
        private static int CalculateTotalPollution()
        {
            int pollution = 0;

            pollution += PlayerBuildingManager.GetTotalPollution();

            return(pollution);
        }
예제 #3
0
        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;
            }
        }
예제 #4
0
 public static int GetCashflow()
 {
     return(PlayerBuildingManager.GetTotalMaintenanceCost() * -1 + CityBuildingManager.GetTotalIncome());
 }