Example #1
0
        public void NewEvent()
        {
            bool _isPoliceStation = false;

            CalculEventProbability();
            PoliceStationType policeStationType = (PoliceStationType)_ctx.BuildingTypes[8];

            if (policeStationType.List.Count != 0)
            {
                _isPoliceStation = true;
            }

            if (_isPoliceStation == true)
            {
                CalculNbEventReal();
                for (int i = 0; i < NbEventReal; i++)
                {
                    IsBuildingGettingEvent();
                    if (IsEventHappening == true)
                    {
                        BuildingEvent();
                        PreviousEvent = true;
                    }
                    else
                    {
                        PreviousEvent = false;
                    }
                }
            }
        }
Example #2
0
        public void CalculNbEventMax()
        {
            PoliceStationType policeStationType = (PoliceStationType)_ctx.BuildingTypes[8];
            int totalNbVehicule = 0;

            for (int i = 0; i < policeStationType.List.Count; i++)
            {
                PoliceStation p = (PoliceStation)policeStationType.List[i];
                totalNbVehicule += p.NbVehicule;
            }

            if (totalNbVehicule < 2)
            {
                NbEventMax = 3;
            }
            else if (totalNbVehicule >= 2 || totalNbVehicule <= 4)

            {
                NbEventMax = 7;
            }

            else

            {
                NbEventMax = 15;
            }
        }