public Equipe_Competition(Membre cptn, Competition compet, List <Membre> equipe) { this.capitaine = cptn; this.competition_engagee = compet; foreach (Membre element in equipe) { if (!this.Ajouter_un_membre(element)) { Console.WriteLine("Erreur : Un membre de la liste ne peut pas participer a la compet"); this.composition_Equipe = null; } } if (this.composition_Equipe != null) { this.tab_points_joueurs = new int[composition_Equipe.Count]; this.composition_Equipe = equipe; composition_Equipe.Add(cptn); foreach (Membre element in equipe) { element.Equipes.Add(this); } } }
public void FaireAjoutUnMembre(Membre aAjouter) { this.composition_Equipe.Add(aAjouter); aAjouter.Equipes.Add(this); }
public bool Ajouter_un_membre(Membre A_Ajouter)// test plein de condition pour voir si on peut ajouter un membre a la competition { bool Ajout_reussi = false; if (A_Ajouter.Calcul_age() < 18) { if ((A_Ajouter.Calcul_age() == this.competition_engagee.Tranche_age) || (A_Ajouter.Calcul_age() == this.competition_engagee.Tranche_age + 1)) { if ((A_Ajouter.Sexe.ToLower() == "f" && (this.competition_engagee.TypeCompetition == "simple femme" || this.competition_engagee.TypeCompetition == "double femme" || this.competition_engagee.TypeCompetition == "equipe femme")) || (A_Ajouter.Sexe.ToLower() == "m" && (this.competition_engagee.TypeCompetition == "simple homme" || this.competition_engagee.TypeCompetition == "double homme" || this.competition_engagee.TypeCompetition == "equipe homme"))) { Ajout_reussi = true; foreach (Equipe_Competition element in A_Ajouter.Equipes) { if ((element.competition_engagee.Date_debut_evenement >= this.competition_engagee.Date_debut_evenement) && (element.competition_engagee.Date_debut_evenement <= this.competition_engagee.Date_fin_evenement) || (element.competition_engagee.Date_fin_evenement >= this.competition_engagee.Date_debut_evenement) && (element.competition_engagee.Date_fin_evenement <= this.competition_engagee.Date_fin_evenement) || (element.competition_engagee.Date_debut_evenement <= this.competition_engagee.Date_debut_evenement) && (element.competition_engagee.Date_fin_evenement >= this.competition_engagee.Date_fin_evenement)) { Ajout_reussi = false; } } foreach (Stage element in A_Ajouter.Stage) { if ((element.Date_debut_evenement >= this.competition_engagee.Date_debut_evenement) && (element.Date_debut_evenement <= this.competition_engagee.Date_fin_evenement) || (element.Date_fin_evenement >= this.competition_engagee.Date_debut_evenement) && (element.Date_fin_evenement <= this.competition_engagee.Date_fin_evenement) || (element.Date_debut_evenement <= this.competition_engagee.Date_debut_evenement) && (element.Date_fin_evenement >= this.competition_engagee.Date_fin_evenement)) { Ajout_reussi = false; } } } } } else { if ((A_Ajouter.Calcul_age() >= this.competition_engagee.Tranche_age) && (A_Ajouter.Calcul_age() <= (this.competition_engagee.Tranche_age + 10))) { if ((A_Ajouter.Sexe.ToLower() == "f" && (this.competition_engagee.TypeCompetition == "simple femme" || this.competition_engagee.TypeCompetition == "double femme" || this.competition_engagee.TypeCompetition == "equipe femme")) || (A_Ajouter.Sexe.ToLower() == "m" && (this.competition_engagee.TypeCompetition == "simple homme" || this.competition_engagee.TypeCompetition == "double homme" || this.competition_engagee.TypeCompetition == "equipe homme"))) { Ajout_reussi = true; foreach (Equipe_Competition element in A_Ajouter.Equipes) { if ((element.competition_engagee.Date_debut_evenement >= this.competition_engagee.Date_debut_evenement) && (element.competition_engagee.Date_debut_evenement <= this.competition_engagee.Date_fin_evenement) || (element.competition_engagee.Date_fin_evenement >= this.competition_engagee.Date_debut_evenement) && (element.competition_engagee.Date_fin_evenement <= this.competition_engagee.Date_fin_evenement) || (element.competition_engagee.Date_debut_evenement <= this.competition_engagee.Date_debut_evenement) && (element.competition_engagee.Date_fin_evenement >= this.competition_engagee.Date_fin_evenement)) { Ajout_reussi = false; } } foreach (Stage element in A_Ajouter.Stage) { if ((element.Date_debut_evenement >= this.competition_engagee.Date_debut_evenement) && (element.Date_debut_evenement <= this.competition_engagee.Date_fin_evenement) || (element.Date_fin_evenement >= this.competition_engagee.Date_debut_evenement) && (element.Date_fin_evenement <= this.competition_engagee.Date_fin_evenement) || (element.Date_debut_evenement <= this.competition_engagee.Date_debut_evenement) && (element.Date_fin_evenement >= this.competition_engagee.Date_fin_evenement)) { Ajout_reussi = false; } } } } } return(Ajout_reussi); }
public void Ajout_point1(Membre gagnant, Equipe_Competition equipe_gagnante) { gagnant.Ajouter_Victore_Simple(); equipe_gagnante.Points_Equipe = equipe_gagnante.Points_Equipe + 1; }
public void Ajout_point2(Membre gagnant1, Membre gagnant2, Equipe_Competition equipe_gagnante) { gagnant1.Ajouter_Victore_Double(); gagnant2.Ajouter_Victore_Double(); equipe_gagnante.Points_Equipe = equipe_gagnante.Points_Equipe + 2; }
public void AjouterMembre(string nom, string prenom, string sexe, string adresse, string ville, DateTime date_naissance, string tel, int argent_depart, double competition) { Membre ajout = new Membre(nom, prenom, sexe, adresse, ville, date_naissance, tel, this, argent_depart, competition); liste_membre.Add(ajout); }
public void Ajouter_membre(Membre membre) { eleves.Add(membre); }