/// <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>(); } } }
/// <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>(); }
public void ConnectToGameCallback(CurentGameResponse response) { syncContext.Post(new SendOrPostCallback(OnBroadcast <CurentGameResponse>), response); }
public void GiveConnectedOpponentInfo(CurentGameResponse response) { syncContext.Post(new SendOrPostCallback(OnBroadcast <CurentGameResponse>), response); }