Beispiel #1
0
 //Displays the winner in a message box on the screen
 private void DisplayWinner(Winner wnrWinner)
 {
     //If there is a winner
     if (wnrWinner != Winner.None)
     {
         plrX.OnWinnerAnnounced(wnrWinner);
         plrX.OnGameEnded();
         plrO.OnWinnerAnnounced(wnrWinner);
         plrO.OnGameEnded();
         //Show the score on the screen
         UpdateScore();
         //Show the winning message based on the winner (this is an extension function)
         MessageBox.Show(wnrWinner.GetWinMessage(plrX, plrO));
         //Reset the board to its original state
         ResetBoard();
     }
 }