/// <summary>
 /// metodo que manda a la historia con estado 0
 /// </summary>
 private void estado0()
 {
     fondoIMG.Source        = new BitmapImage(new Uri("C:/Users/rockm/Desktop/5to Semestre/Tecnologias/10ma iteracion/ClienteProyecto/ClienteProyecto/Imagenes/explicacion2.png"));
     explicacionIMG.Content = Properties.Resources.labelExplicacion2;
     this.estado            = 1;
     ServiceReference4.Service1Client service = new ServiceReference4.Service1Client();
     service.SetCampaniaJugador(idJugador, 1);
 }
        /// <summary>
        /// metodo que manda a el juego con estado 1
        /// </summary>
        private void estado1()
        {
            ServiceReference4.Service1Client service = new ServiceReference4.Service1Client();
            service.SetCampaniaJugador(idJugador, 2);
            JuegoCampaña juego = new JuegoCampaña();

            juego.setIdioma(idioma);
            juego.getID(idJugador);
            juego.ajustarImagenes(2);
            juego.Show();
            this.Close();
        }
 private void Button_Click(object sender, RoutedEventArgs e)  //LLama a la historia nueva
 {
     try {
         ServiceReference4.Service1Client service1Client = new ServiceReference4.Service1Client();
         service1Client.SetCampaniaJugador(idJugador, 1);
         Historia historia = new Historia();
         historia.getID(idJugador);
         historia.setIdioma(idioma);
         historia.setIMG(0);
         historia.Show();
         this.Close();
     } catch (System.ServiceModel.EndpointNotFoundException) {
         MessageBox.Show("Hubo un error al conectar con el servidor", "Error en el host");
     }
 }
 /// <summary>
 /// metodo que manda a el juego con estado 3
 /// </summary>
 private void estado3()
 {
     try {
         ServiceReference4.Service1Client service = new ServiceReference4.Service1Client();
         service.SetCampaniaJugador(idJugador, 5);
         JuegoCampaña juego = new JuegoCampaña();
         juego.setIdioma(idioma);
         juego.getID(idJugador);
         juego.ajustarImagenes(5);
         juego.Show();
         this.Close();
     } catch (System.ServiceModel.EndpointNotFoundException) {
         MessageBox.Show("Hubo un error al conectar con el servidor", "Error en el host");
     }
 }
 /// <summary>
 /// metodo que reinicia el progreso del jugador a 0
 /// </summary>
 private void estado17()
 {
     ServiceReference4.Service1Client service = new ServiceReference4.Service1Client();
     service.SetCampaniaJugador(idJugador, 0);
 }
        /// <summary>
        /// metodo que define la interaccion cuando gana el jugador
        /// </summary>
        /// <param name="avance">numero de avance en la campaña del jugador</param>
        private void manejarVictoria(int avance)
        {
            ServiceReference4.Service1Client service1Client = new ServiceReference4.Service1Client();
            switch (avance)
            {
            case 2: {
                service1Client.SetCampaniaJugador(idJugador, 3);
                Historia historia = new Historia();
                historia.getID(idJugador);
                historia.setIdioma(idioma);
                historia.setIMG(3);
                historia.Show();
                this.Close();
            }
            break;

            case 5: {
                service1Client.SetCampaniaJugador(idJugador, 7);
                Historia historia = new Historia();
                historia.getID(idJugador);
                historia.setIdioma(idioma);
                historia.setIMG(7);
                historia.Show();
                this.Close();
            }
            break;

            case 8: {
                service1Client.SetCampaniaJugador(idJugador, 10);
                Historia historia = new Historia();
                historia.getID(idJugador);
                historia.setIdioma(idioma);
                historia.setIMG(10);
                historia.Show();
                this.Close();
            }
            break;

            case 11: {
                service1Client.SetCampaniaJugador(idJugador, 13);
                Historia historia = new Historia();
                historia.getID(idJugador);
                historia.setIdioma(idioma);
                historia.setIMG(13);
                historia.Show();
                this.Close();
            }
            break;

            case 14: {
                service1Client.SetCampaniaJugador(idJugador, 16);
                Historia historia = new Historia();
                historia.getID(idJugador);
                historia.setIdioma(idioma);
                historia.setIMG(16);
                historia.Show();
                this.Close();
            }
            break;

            default: {
                MessageBox.Show("Lo sentimos pero ocurrio un error inesperado y progreso se reinició", "Ocurrio" +
                                "un error");
            }
            break;
            }
        }