private void NewLocalGameBtn_Click(object sender, RoutedEventArgs e) { menuContent.Children.Clear(); var lanGameLobbyControl = new LanGameLobbyControl(this); menuContent.Children.Add(lanGameLobbyControl); }
private async void AnotherPlayerDisconnected() { if (lanGameSession.IsGameStarted) { MessageBox.Show("К сожалению, другой игрок покинул игру :(", "Игра завершена", MessageBoxButton.OK, MessageBoxImage.Information); } PrepareForNewGame(); lanGameLobbyControl.ShowMainMenu(); await lanGameSession.DisconnectAsync(); lanGameSession = null; lanGameLobbyControl = null; }
protected override void NewLocalGame(LanGameSession lanGameSession, LanGameLobbyControl lanGameLobbyControl) { NewSingleGame(); this.gameType = GameType.Local; this.lanGameLobbyControl = lanGameLobbyControl; this.lanGameSession = lanGameSession; whiteIsMyColor = lanGameSession.IsServer; if (!lanGameSession.IsServer) { GetLocalGameStep(); Rotate(180); } else { Rotate(0); } }
public override void NewGame(LanGameSession lanGameSession, LanGameLobbyControl lanGameLobbyControl) => NewLocalGame(lanGameSession, lanGameLobbyControl);
protected abstract void NewLocalGame(LanGameSession lanGameSession, LanGameLobbyControl lanGameLobbyControl);
public abstract void NewGame(LanGameSession lanGameSession, LanGameLobbyControl lanGameLobbyControl);