/// <summary> /// Callback que borra en pantalla la imagen de un lisman cuando abandonó la partida /// </summary> /// <param name="colorGame">Identificador del color del lisman que abandonó la partida</param> public void NotifyLismanLeaveGame(int colorGame) { switch (colorGame) { case LISMANYELLOW: LismanYellowImage.Visibility = Visibility.Hidden; break; case LISMANRED: LismanRedImage.Visibility = Visibility.Hidden; break; case LISMANBLUE: LismanBlueImage.Visibility = Visibility.Hidden; break; case LISMANGREEN: LismanGreenImage.Visibility = Visibility.Hidden; break; } if (playerColor == colorGame) { MessageBox.Show(Properties.Resources.message_lisman_left_game); MultiplayerHome window = new MultiplayerHome(); reconnectionTimer.Stop(); window.Show(); this.Close(); } }
/// <summary> /// Callback que notifica a los jugadores cuando uno esta muerto y borra la imagen del mapa /// </summary> /// <param name="colorPlayer">Identificador del color del lisman que sera borrado</param> public void NotifyPlayerIsDead(int colorPlayer) { switch (colorPlayer) { case LISMANYELLOW: LismanYellowImage.Visibility = Visibility.Hidden; break; case LISMANRED: LismanRedImage.Visibility = Visibility.Hidden; break; case LISMANBLUE: LismanBlueImage.Visibility = Visibility.Hidden; break; case LISMANGREEN: LismanGreenImage.Visibility = Visibility.Hidden; break; } if (playerColor == colorPlayer) { MessageBox.Show(Properties.Resources.message_lose_game); MultiplayerHome window = new MultiplayerHome(); window.Show(); this.Close(); } }
private void button_multiplayerMode_Click(object sender, RoutedEventArgs e) { MultiplayerHome multiplayerWindow = new MultiplayerHome(); multiplayerWindow.Show(); this.Close(); }
/// <summary> /// Callback que notifica al jugador restante que acabó la partida y ha ganado /// </summary> /// <param name="colorLisman">Identificador del color del jugador que ganó la partida</param> public void NotifyEndGame(int colorLisman) { MessageBox.Show(Properties.Resources.message_you_win); MultiplayerHome windowHome = new MultiplayerHome(); reconnectionTimer.Stop(); windowHome.Show(); this.Close(); }
private void btn_exitGame_Click(object sender, RoutedEventArgs e) { MultiplayerHome homeMultiplayer = new MultiplayerHome(); LismanService.GameManagerClient clientGame = new LismanService.GameManagerClient(); try { clientGame.LeaveGame(SingletonAccount.getSingletonAccount().User, idGame); client.LeaveChat(SingletonAccount.getSingletonAccount().User, idGame); homeMultiplayer.Show(); this.Close(); } catch (Exception ex) { MessageBox.Show(Properties.Resources.server_connection_error); Logger.log.Warn("Error en funcion exit game " + ex.Message); } }