Exemple #1
0
 private void chooseColors()
 {
     blackPlayer = game.assignColor(leftPlayer, rightPlayer);
     if (ReferenceEquals(blackPlayer, leftPlayer))
     {
         whitePlayer = rightPlayer;
         leftPlayerScore.ForeColor  = Color.Black;
         LeftDiscsLeft.ForeColor    = Color.Black;
         rightPlayerScore.ForeColor = Color.White;
         RightDiscsLeft.ForeColor   = Color.White;
         MessageBox.Show("Color chosen randomly: Left is black and right is white.");
         game.blackStack = leftStack;
         game.whiteStack = rightStack;
         pG5.FillEllipse(new SolidBrush(Color.White), 0, 0, panel4.Width, panel4.Width);
         pG4.FillEllipse(new SolidBrush(Color.Black), 0, 0, panel4.Width, panel4.Width);
     }
     else
     {
         leftPlayerScore.ForeColor  = Color.White;
         LeftDiscsLeft.ForeColor    = Color.White;
         rightPlayerScore.ForeColor = Color.Black;
         RightDiscsLeft.ForeColor   = Color.Black;
         whitePlayer = leftPlayer;
         MessageBox.Show("Color chosen randomly: Right is black and left is white.");
         game.blackStack = rightStack;
         game.whiteStack = leftStack;
         pG4.FillEllipse(new SolidBrush(Color.White), 0, 0, panel4.Width, panel4.Width);
         pG5.FillEllipse(new SolidBrush(Color.Black), 0, 0, panel4.Width, panel4.Width);
     }
     game.setPlayer(blackPlayer, whitePlayer);
 }