Ejemplo n.º 1
0
 private void Form2_OnGameEnded(object sender, GameEndedEventArgs e)
 {
     if (e.Joueur == 1)
     {
         if ((this.Set.Score1.Point == 6) && (this.Set.Score1.Point - 2 >= this.Set.Score2.Point))
         {
             SetEndedEventArgs seea = new SetEndedEventArgs(1, this.Set);
             this.OnSetEnded(this, seea);
             this.Set.Score1.Point = 0;
         }
         else
         {
             this.Set.ListeJeu.AddLast(new Jeu(e.Jeu));
             if (e.Jeu.Score1.Point > e.Jeu.Score2.Point)
                 this.Set.Score1.Point++;
             else if (e.Jeu.Score1.Point < e.Jeu.Score2.Point)
                 this.Set.Score2.Point++;
             else
                 this.Set.Score1.Point++;
         }
     }
     else
     {
         if ((this.Set.Score2.Point == 6) && (this.Set.Score2.Point - 2 >= this.Set.Score1.Point))
         {
             SetEndedEventArgs seea = new SetEndedEventArgs(2, this.Set);
             this.OnSetEnded(this, seea);
             this.Set.Score2.Point = 0;
         }
         else
         {
             this.Set.ListeJeu.AddLast(new Jeu(e.Jeu));
             if (e.Jeu.Score1.Point > e.Jeu.Score2.Point)
                 this.Set.Score1.Point++;
             else if (e.Jeu.Score1.Point < e.Jeu.Score2.Point)
                 this.Set.Score2.Point++;
             else
                 this.Set.Score2.Point++;
         }
     }
     this.setJoueur1ToolBox.Text = this.Set.Score1.Point.ToString();
     this.setJoueur2ToolBox.Text = this.Set.Score2.Point.ToString();
 }
Ejemplo n.º 2
0
 private void Pong_OnSetEnded(object sender, SetEndedEventArgs e)
 {
     if (e.Joueur == 1)
     {
         if (this.Match.Score1.Point == 3)
         {
             MatchEndedEventArgs meea = new MatchEndedEventArgs(this.Match);
             this.onMatchEnded(this, meea);
             this.Match.Score1.Point = 0;
         }
         else
         {
             this.Match.ListeSet.AddLast(new Set(e.Set));
             if (e.Set.Score1.Point > e.Set.Score2.Point)
                 this.Match.Score1.Point++;
             else if (e.Set.Score1.Point < e.Set.Score2.Point)
                 this.Match.Score2.Point++;
             else
                 this.Match.Score1.Point++;
         }
     }
     else
     {
         if (this.Match.Score2.Point == 3)
         {
             MatchEndedEventArgs meea = new MatchEndedEventArgs(this.Match);
             this.onMatchEnded(this, meea);
             this.Match.Score2.Point = 0;
         }
         else
         {
             this.Match.ListeSet.AddLast(new Set(e.Set));
             if (e.Set.Score1.Point > e.Set.Score2.Point)
                 this.Match.Score1.Point++;
             else if (e.Set.Score1.Point < e.Set.Score2.Point)
                 this.Match.Score2.Point++;
             else
                 this.Match.Score2.Point++;
         }
     }
     this.ScoreTexteJoueur1.Texto = this.ScoreJoueur1.Point.ToString() + " - " +
         this.Jeu.Score1.Point.ToString() + " - " + this.Set.Score1.Point.ToString() + " - " +
         this.Match.Score1.Point.ToString();
     this.ScoreTexteJoueur2.Texto = this.ScoreJoueur2.Point.ToString() + " - " +
         this.Jeu.Score2.Point.ToString() + " - " + this.Set.Score2.Point.ToString() + " - " +
         this.Match.Score2.Point.ToString();
 }
Ejemplo n.º 3
0
 private void Form2_OnSetEnded(object sender, SetEndedEventArgs e)
 {
     if (e.Joueur == 1)
     {
         if (this.Match.Score1.Point == 3)
         {
             MatchEndedEventArgs meea = new MatchEndedEventArgs(this.Match);
             this.onMatchEnded(this, meea);
             this.Match.Score1.Point = 0;
         }
         else
         {
             this.Match.ListeSet.AddLast(new Set(e.Set));
             if (e.Set.Score1.Point > e.Set.Score2.Point)
                 this.Match.Score1.Point++;
             else if (e.Set.Score1.Point < e.Set.Score2.Point)
                 this.Match.Score2.Point++;
             else
                 this.Match.Score1.Point++;
         }
     }
     else
     {
         if (this.Match.Score2.Point == 3)
         {
             MatchEndedEventArgs meea = new MatchEndedEventArgs(this.Match);
             this.onMatchEnded(this, meea);
             this.Match.Score2.Point = 0;
         }
         else
         {
             this.Match.ListeSet.AddLast(new Set(e.Set));
             if (e.Set.Score1.Point > e.Set.Score2.Point)
                 this.Match.Score1.Point++;
             else if (e.Set.Score1.Point < e.Set.Score2.Point)
                 this.Match.Score2.Point++;
             else
                 this.Match.Score2.Point++;
         }
     }
     this.matchJoueur1ToolBox.Text = this.Match.Score1.Point.ToString();
     this.matchJoueur2ToolBox.Text = this.Match.Score2.Point.ToString();
 }
Ejemplo n.º 4
0
 private void Pong_OnGameEnded(object sender, GameEndedEventArgs e)
 {
     if (e.Joueur == 1)
     {
         if ((this.Set.Score1.Point == 6) && (this.Set.Score1.Point - 2 >= this.Set.Score2.Point))
         {
             SetEndedEventArgs seea = new SetEndedEventArgs(1, this.Set);
             this.OnSetEnded(this, seea);
             this.Set.Score1.Point = 0;
         }
         else
         {
             this.Set.ListeJeu.AddLast(new Jeu(e.Jeu));
             if (e.Jeu.Score1.Point > e.Jeu.Score2.Point)
                 this.Set.Score1.Point++;
             else if (e.Jeu.Score1.Point < e.Jeu.Score2.Point)
                 this.Set.Score2.Point++;
             else
                 this.Set.Score1.Point++;
         }
     }
     else
     {
         if ((this.Set.Score2.Point == 6) && (this.Set.Score2.Point - 2 >= this.Set.Score1.Point))
         {
             SetEndedEventArgs seea = new SetEndedEventArgs(2, this.Set);
             this.OnSetEnded(this, seea);
             this.Set.Score2.Point = 0;
         }
         else
         {
             this.Set.ListeJeu.AddLast(new Jeu(e.Jeu));
             if (e.Jeu.Score1.Point > e.Jeu.Score2.Point)
                 this.Set.Score1.Point++;
             else if (e.Jeu.Score1.Point < e.Jeu.Score2.Point)
                 this.Set.Score2.Point++;
             else
                 this.Set.Score2.Point++;
         }
     }
     this.ScoreTexteJoueur1.Texto = this.ScoreJoueur1.Point.ToString() + " - " +
         this.Jeu.Score1.Point.ToString() + " - " + this.Set.Score1.Point.ToString() + " - " +
         this.Match.Score1.Point.ToString();
     this.ScoreTexteJoueur2.Texto = this.ScoreJoueur2.Point.ToString() + " - " +
         this.Jeu.Score2.Point.ToString() + " - " + this.Set.Score2.Point.ToString() + " - " +
         this.Match.Score2.Point.ToString();
 }