Exemple #1
0
 public void Pong_OnSetEnded(object sender, SetEndedEventArgs e)
 {
     if (e.Joueur == 1)
     {
         if (this.Parent.Match.Score1.Point == 3)
         {
             MatchEndedEventArgs meea = new MatchEndedEventArgs(this.Parent.Match);
             this.onMatchEnded(this, meea);
             this.Parent.Match.Score1.Point = 0;
         }
         else
         {
             this.Parent.Match.ListeSet.AddLast(new Set(e.Set));
             if (e.Set.Score1.Point > e.Set.Score2.Point)
                 this.Parent.Match.Score1.Point++;
             else if (e.Set.Score1.Point < e.Set.Score2.Point)
                 this.Parent.Match.Score2.Point++;
             else
                 this.Parent.Match.Score1.Point++;
         }
     }
     else
     {
         if (this.Parent.Match.Score2.Point == 3)
         {
             MatchEndedEventArgs meea = new MatchEndedEventArgs(this.Parent.Match);
             this.onMatchEnded(this, meea);
             this.Parent.Match.Score2.Point = 0;
         }
         else
         {
             this.Parent.Match.ListeSet.AddLast(new Set(e.Set));
             if (e.Set.Score1.Point > e.Set.Score2.Point)
                 this.Parent.Match.Score1.Point++;
             else if (e.Set.Score1.Point < e.Set.Score2.Point)
                 this.Parent.Match.Score2.Point++;
             else
                 this.Parent.Match.Score2.Point++;
         }
     }
 }
Exemple #2
0
 public void Pong_onMatchEnded(object sender, MatchEndedEventArgs e)
 {
     this.Parent.ScoreJoueur1 = new Score();
     this.Parent.ScoreJoueur2 = new Score();
     this.Parent.Jeu = new Jeu();
     this.Parent.Set = new Set();
     this.Parent.Match = new Match();
 }