예제 #1
0
        private void Button_Clue_Click(object sender, RoutedEventArgs e)
        {
            int counter = 1;

            if (playerClient.GetScore(playerThis.UserName) > 0)
            {
                while (counter < 4)
                {
                    Random random       = new Random();
                    int    randomNumber = random.Next(1, 16);
                    if (gameClient.GetIdSelectedCharacterPlayerOne(idGame) == randomNumber || gameClient.GetIdSelectedCharacterPlayerTwo(idGame) == randomNumber)
                    {
                        counter--;
                    }
                    else
                    {
                        ShowCrossOutCharacter(randomNumber);
                        button_Clue.Visibility = Visibility.Hidden;
                    }
                    counter++;
                }
                playerClient.SubtractOneScore(playerThis.UserName);
                label_Message_EE.Content = "EE: " + playerClient.GetScore(playerThis.UserName);
            }
            else
            {
                label_MessageClue.Content = Properties.Resources.message_EEInsufficient;
            }
        }
예제 #2
0
 private void Button_Start_Click(object sender, RoutedEventArgs e)
 {
     try {
         if (gameClient.GetIdSelectedCharacterPlayerOne(idGame) > 0)
         {
             if (gameClient.GetIdSelectedCharacterPlayerTwo(idGame) > 0)
             {
                 startGameClient.OpenPlayerMatchBoard(idGame, playerThis.UserName);
             }
             else
             {
                 label_Message.Content = Properties.Resources.label_MessageWaitingPlayer;
             }
         }
         else
         {
             label_Message.Content = Properties.Resources.label_MessageChooseCharacter;
         }
     } catch (Exception) {
         ServerFailed serverFailed = new ServerFailed();
         serverFailed.Show();
         this.Close();
     }
 }