Exemplo n.º 1
0
        /// <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();
            }
        }
Exemplo n.º 2
0
        /// <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();
            }
        }
Exemplo n.º 3
0
        private void button_multiplayerMode_Click(object sender, RoutedEventArgs e)
        {
            MultiplayerHome multiplayerWindow = new MultiplayerHome();

            multiplayerWindow.Show();
            this.Close();
        }
Exemplo n.º 4
0
        /// <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();
        }
Exemplo n.º 5
0
        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);
            }
        }