public void NewEvent() { bool _isHospital = false; CalculEventProbability(); HospitalType hospitalType = (HospitalType)_ctx.BuildingTypes[3]; if (hospitalType.List.Count != 0) { _isHospital = true; } if (_isHospital == true) { CalculNbEventReal(); for (int i = 0; i < NbEventReal; i++) { SelectKindOfSick(); IsBuildingGettingEvent(); if (IsEventHappening == true) { BuildingEvent(); PreviousEvent = true; } else { PreviousEvent = false; } } } }
public void CalculNbEventMax() { HospitalType hospitalType = (HospitalType)_ctx.BuildingTypes[3]; int totalNbVehicule = 0; int totalNbBed = 0; for (int i = 0; i < hospitalType.List.Count; i++) { Hospital h = (Hospital)hospitalType.List[i]; totalNbVehicule += h.NbVehicule; totalNbBed += h.NbBed; } if (totalNbVehicule < 3 && totalNbBed < 20) { NbEventMax = 3; } else if (totalNbVehicule < 6 && totalNbBed < 50) { NbEventMax = 8; } else { NbEventMax = 20; } }