public void Add(Epreuve uneEpreuve, int tempsRealise) { if (resultatPresent(uneEpreuve) == false) { Resultat nouveauParticipant = new Resultat(this, uneEpreuve, tempsRealise); lesResultats.Add(nouveauParticipant); } }
public Tri(string nature, int distanceNatation, int distanceVelo, int distanceCourse) { this.nature = nature; natation = new Epreuve("natation", distanceNatation); velo = new Epreuve("vélo", distanceVelo); course = new Epreuve("course", distanceCourse); List <Participant> lesParticipants = new List <Participant>(); }
private bool resultatPresent(Epreuve uneEpreuve) { foreach (Resultat res in lesResultats) { if (res.GetEpreuve.GetNom() == uneEpreuve.GetNom()) { return(true); } } return(false); }
private bool resultatPresent(Epreuve uneEpreuve) { for (int i = 0; i < lesResultats.Count; i++) { if (lesResultats[i].GetEpreuve().GetNom() == uneEpreuve.GetNom()) { return(true); } } return(false); }
public Resultat(Participant unParticipant, Epreuve uneEpreuve, int tempsRealise) { this.unParticipant = unParticipant; this.uneEpreuve = uneEpreuve; this.tempsRealise = tempsRealise; }