public ReglasPiedraPapelTijeraSteps() { bus = new DomainEventBus(); partida = new Partida(bus); jugador1 = new Jugador1(bus); jugador2 = new Jugador2(bus); resultados = new Resultados(bus); }
private void Button_Click_2(object sender, RoutedEventArgs e) { Jugador1.AtacarCarta(Jugador1.tablero, Int32.Parse(TextAtacante.Text), Jugador2.tablero, Int32.Parse(TextDefensor.Text)); Tablero tablero = new Tablero(Jugador1, Jugador2); tablero.Show(); this.Close(); }
private void Button_Click(object sender, RoutedEventArgs e) { Jugador1.JugarCartas(Jugador1.mano, Jugador1.tablero, Int32.Parse(CartaAJugar.Text), Jugador1.manaTurno); Tablero tablero = new Tablero(Jugador1, Jugador2); tablero.Show(); this.Close(); }
/// <summary> /// Juega un solo intercambio de disparos /// </summary> public void jugarRonda() { var coordenadas = Jugador1.Disparo(); var resultado = Jugador2.procesarDisparo(coordenadas); Jugador1.procesarResultado(coordenadas, resultado); if (!Jugador2.haPerdido) { coordenadas = Jugador2.Disparo(); resultado = Jugador1.procesarDisparo(coordenadas); Jugador2.procesarResultado(coordenadas, resultado); } }
private void BotonPasarTurno2a1_Click(object sender, RoutedEventArgs e) { int a = 0; List <string> ManoTurno = new List <string>(); ManoTurno.Clear(); while (a < Jugador1.mano.Count()) { ManoTurno.Add(Jugador1.mano[a].nombre + "|" + Jugador1.mano[a].ataque + "|" + Jugador1.mano[a].vida + "|" + Jugador1.mano[a].costo); a += 1; } int b = 0; List <string> Tablero1 = new List <string>(); Tablero1.Clear(); while (b < Jugador2.tablero.Count()) { Tablero1.Add(Jugador2.tablero[b].nombre + "|" + Jugador2.tablero[b].ataque + "|" + Jugador2.tablero[b].vida + "|" + Jugador2.tablero[b].costo); b += 1; } TableroRival.ItemsSource = Tablero1; int c = 0; List <string> Tablero2 = new List <string>(); Tablero2.Clear(); while (c < Jugador1.tablero.Count()) { Tablero1.Add(Jugador1.tablero[c].nombre + "|" + Jugador1.tablero[c].ataque + "|" + Jugador1.tablero[c].vida + "|" + Jugador1.tablero[c].costo); c += 1; } TableroTablero.ItemsSource = Tablero2; ListMano.ItemsSource = ManoTurno; Jugador1.ManaGrowth(); Jugador1.turno += 2; BotonPasarTurno2a1.Visibility = System.Windows.Visibility.Hidden; BotonPasarTurno1a2.Visibility = System.Windows.Visibility.Visible; NombreJugadorShow.Content = "Turno de " + Jugador1.nombre; VidaJugador.Content = "Tienes " + Jugador1.vida + " puntos de vida."; VidaJugadorOponente.Content = "Tu oponente tiene " + Jugador2.vida + " puntos de vida."; ManaTurnoLabel.Content = "Tienes " + Jugador1.mana.ToString() + "puntos de mana"; //Hay que ver como ponemos esto, tiene que ser mana turno }
public void RepartirCartas() { if ((Jugador1.ConectionID != null || Jugador2.ConectionID != null) && this.MazoCompleto != null) { this.MazoCompleto.MazclarCartas(); int Contador = 0; foreach (var carta in this.MazoCompleto.Cartas) { Contador += 1; if ((Contador % 2) == 0) { Jugador1.AñadirCartas(carta); } else { Jugador2.AñadirCartas(carta); } } } }
public void RepartirCartas() { if (MazoPartida != null && MazoPartida.Cartas != null && MazoPartida.Cartas.Count() != 0 && Jugador1 != null && Jugador2 != null) { this.MezclarMazo(); int cantidadcartas = MazoPartida.Cartas.Count(); if (cantidadcartas % 2 != 0) { cantidadcartas -= 1; } for (int i = 0; i < cantidadcartas; i++) { if (i % 2 == 0) { Jugador1.RecibirCartas(MazoPartida.Cartas[i]); } else { Jugador2.RecibirCartas(MazoPartida.Cartas[i]); } } } }
private void Button_Click_2(object sender, RoutedEventArgs e) { Jugador1.UsarPoder(Jugador1, Jugador2, ReclutaManodePlata, listaCartasShaman, dagger); }