private CAeronef ChoisirAeronef(typeClient clientType) { typeAvion aeronefType; switch (clientType) { case typeClient.Incendie: aeronefType = typeAvion.Citerne; break; case typeClient.Detresse: aeronefType = typeAvion.Secours; break; case typeClient.Point: aeronefType = typeAvion.Loisir; break; default: return(null); } List <CAeronef> vehicules = Aeronefs.FindAll(vehicule => (vehicule.etat.Status == EtatAeronef.Inactif && vehicule.Type == aeronefType)); if (vehicules.Count() <= 0) { return(null); } return(vehicules.ElementAt(vehicules.Count - 1)); }
// SurCarte public CClients creeClient(typeClient client, Position mapPosition, int clValue) { // Aeronef Incendie if (client == typeClient.Incendie) { return(new CIncendie(client, mapPosition, clValue)); // ClValue = Intensite } else if (client == typeClient.Point) { return(new CPoint(client, mapPosition, clValue)); // clValue = rayon } return(null); }
//Creer un incendit ou un point d'intérêt private void CreerSurCarte(typeClient type) { Random rand = new Random(DateTime.Now.Millisecond); int value = rand.Next(1, 3); //Creer un valeur aleatoire //creer un position aléatoire sur la carte int x = rand.Next(0, Resource.carte_du_monde.Width); int y = rand.Next(0, Resource.carte_du_monde.Height); Position mapPosition = new Position(x, y); UsineClient usineClient = new UsineClient(); TrouverAeroportProche(mapPosition, trouverAvionPourClient(type)).AjouterClient(usineClient.creeClient(type, mapPosition, value)); }
private typeAvion trouverAvionPourClient(typeClient client) { switch (client) { case typeClient.Voyageur: return(typeAvion.Passager); case typeClient.Cargaison: return(typeAvion.Cargo); case typeClient.Point: return(typeAvion.Loisir); case typeClient.Incendie: return(typeAvion.Citerne); case typeClient.Detresse: return(typeAvion.Secours); } return(typeAvion.Passager); }
public CCargaison(typeClient client, CAeroport aeroport, double poid) : base(client, aeroport) { m_poid = poid; Destination = aeroport; }
public CDetresse(typeClient client, Position position) : base(client, position) { }
public CIncendie(typeClient client, Position position, int Intensite) : base(client, position) { this.Intensite = Intensite; }
public CClients(typeClient client) { m_client = client; }
public CPoint(typeClient client, Position position, int rayon) : base(client, position) { this.rayon = rayon; }
public CSurCarte(typeClient client, Position position) : base(client) { m_position = position; }
public CVoyageur(typeClient client, CAeroport aeroport, int nombreClient) : base(client, aeroport) { this.nombreClient = nombreClient; Destination = aeroport; }
public CDansAeroport(typeClient client, CAeroport Destination) : base(client) { this.Destination = Destination; }