Example #1
0
 public void JoinOkay(GameDataCommMessage msgGameData)
 {
     if (msgGameData.IsSucceed)
     {
         Dispatcher.Invoke(() =>
         {
             MessageBox.Show("You joined the game successfully!");
             GameScreen newGameWindow = new GameScreen(cl);
             newGameWindow.UpdateGame(msgGameData);
             cl.AddNewRoom(newGameWindow);
             newGameWindow.Show();
             Hide();
         });
     }
     else
     {
         MessageBox.Show("Joined the game failed!");
     }
 }
Example #2
0
        private void CreateBotton_Click(object sender, RoutedEventArgs e)
        {
            if (GameModeComboBox.SelectedIndex == -1)
            {
                MessageBox.Show("Please Choose Game Mode");
                return;
            }
            if (_minPlayer == -1)
            {
                MessageBox.Show("Please enter Minimum Playes");
                return;
            }
            if (_maxPlayers == -1)
            {
                MessageBox.Show("Please enter Maximum Playes");
                return;
            }
            if (_chipPolicy == -1)
            {
                MessageBox.Show("Please enter Chip Policy");
                return;
            }
            if (_buyInPolicy == -1)
            {
                MessageBox.Show("Please enter Buy-In Policy");
                return;
            }
            if (SpectatorsComboBox.SelectedIndex == -1)
            {
                MessageBox.Show("Please choose Spectetors Allowed");
                return;
            }
            if (_minBet == -1)
            {
                MessageBox.Show("Please enter Chip Policy");
                return;
            }
            GameDataCommMessage newRoom = _logic.CreateNewRoom(_mode, _minBet, _chipPolicy, _buyInPolicy, _canSpectate, _minPlayer, _maxPlayers);

            if (newRoom != null)
            {
                MessageBox.Show("New Room sucssesfully Created, Enjoy!");
                GameScreen newGameWindow = new GameScreen(_logic);

                newGameWindow.UpdateGame(newRoom);
                _logic.AddNewRoom(newGameWindow);
                newGameWindow.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("New room creation failed!");
            }
        }
Example #3
0
 public void PlayerReturnResponseReceived(GameDataCommMessage msgGameData)
 {
     if (msgGameData.IsSucceed)
     {
         Dispatcher.Invoke(() =>
         {
             MessageBox.Show("You Return the game successfully! Enjoy");
             GameScreen newGameWindow = new GameScreen(_cl);
             newGameWindow.UpdateGame(msgGameData);
             _cl.AddNewRoom(newGameWindow);
             newGameWindow.Show();
             Hide();
         });
     }
     else
     {
         Dispatcher.Invoke(() =>
         {
             MessageBox.Show("You Can't Return to be a player in this game!");
         });
     }
 }