Esempio n. 1
0
        public void CalculNbEventMax()

        {
            FireStationType fireStationType = (FireStationType)_ctx.BuildingTypes[1];
            int             totalnbTruck    = 0;

            for (int i = 0; i < fireStationType.List.Count; i++)
            {
                FireStation f = (FireStation)fireStationType.List[i];
                totalnbTruck += f.NbVehicule;
            }

            if (totalnbTruck < 2)

            {
                NbEventMax = 3;
            }

            else if (totalnbTruck >= 2 || totalnbTruck <= 4)

            {
                NbEventMax = 7;
            }

            else

            {
                NbEventMax = 15;
            }
        }
Esempio n. 2
0
        public void NewEvent()

        {
            bool _isFireStation = false;

            CalculEventProbability();
            FireStationType fireStationType = (FireStationType)_ctx.BuildingTypes[1];

            if (fireStationType.List.Count != 0)
            {
                _isFireStation = true;
            }



            if (_isFireStation == true)

            {
                CalculNbEventReal();
                for (int i = 0; i <= NbEventReal; i++)

                {
                    IsBuildingGettingEvent();

                    if (IsEventHappening == true)

                    {
                        BuildingEvent();
                        PreviousEvent = true;
                    }

                    else

                    {
                        PreviousEvent = false;
                    }
                }
            }
        }