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; } }
public override void CreateInstance(int x, int y, ResourcesManager resources, Map map) { if (!resources.CheckResourcesNeeded(this)) { throw new ArgumentException("Ressources manquantes."); } resources.UpdateWhenCreate(this); Building building = new FireStation(this, x, y); map.AddBuilding(x, y, building); _list.Add(building); }