private void SearchingGameResponse(string message) { if (message == "game found") { this.gameplayWindow = new GameplayWindow(); this.gameplayWindow.WantMove += GameplayWindow_WantMove; this.gameplayWindow.Move += GameplayWindow_Move; this.gameplayWindow.DeletePawn += GameplayWindow_DeletePawn; fields = gameplayWindow.fields; whitePawns = gameplayWindow.whitePawns; redPawns = gameplayWindow.redPawns; menuWindow.Close(); if (searchingGameWindow != null) { searchingGameWindow.Close(); } this.gameplayWindow.Show(); } else if (message == "wait") { this.searchingGameWindow = new SearchingGameWindow(); this.menuWindow.Close(); this.searchingGameWindow.Show(); } }
public void LoadGameplay() // Loads the gameplay window and its content { if (Windows.ContainsKey("Gameplay")) { Windows["Gameplay"] = new GameplayWindow(); Windows["Pause"] = new PauseWindow(); Windows["Death"] = new DeathWindow(); } else { Windows.Add("Gameplay", new GameplayWindow()); Windows.Add("Pause", new PauseWindow()); Windows.Add("Death", new DeathWindow()); } Windows["Pause"].LoadContent(); }