Example #1
0
        /// <summary>
        /// Получаем подключившегося соперника
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GetOpponent(object sender, ResponseEventArgs e)
        {
            CurentGameResponse response = e.Response as CurentGameResponse;

            if (response != null)
            {
                if (response.IsSuccess)
                {
                    _stateGame = StateGame.PreparationGame;
                    SetEnableControls(_stateGame);
                    ClientManager.Instance.Callback.RemoveHandler <CurentGameResponse>();
                }
            }
        }
Example #2
0
        /// <summary>
        /// Поключаеться к игре
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GetConnectToGames(object sender, ResponseEventArgs e)
        {
            CurentGameResponse response = e.Response as CurentGameResponse;

            if (response != null)
            {
                if (response.IsSuccess)
                {
                    Switcher.SwitchPage(new Game(false));
                }
                else
                {
                    MessageBox.Show(response.Error);
                }
            }
            ClientManager.Instance.Callback.RemoveHandler <CurentGameResponse>();
        }
Example #3
0
 public void ConnectToGameCallback(CurentGameResponse response)
 {
     syncContext.Post(new SendOrPostCallback(OnBroadcast <CurentGameResponse>), response);
 }
Example #4
0
 public void GiveConnectedOpponentInfo(CurentGameResponse response)
 {
     syncContext.Post(new SendOrPostCallback(OnBroadcast <CurentGameResponse>), response);
 }