public Tablero AgregarReina(Reina reina) { reinas.Add(reina); for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if (reina.Posicion.X == i || reina.Posicion.Y == j) { this.posiciones[i][j].AgregarReina(reina.NumeroReina); } else if (Math.Abs(reina.Posicion.X - i) == Math.Abs(reina.Posicion.Y - j)) { this.posiciones[i][j].AgregarReina(reina.NumeroReina); } //else if (Math.Abs(reina.Posicion.X + i) == Math.Abs(reina.Posicion.Y + j)) //{ // this.posiciones[i][j].AgregarReina(reina.NumeroReina); //} } } return this; }
public GenReina(int posicionX, int posicionY, int numeroReina) { this.reina = new Reina(posicionX, posicionY, numeroReina); ; this.Valor = reina; this.Nombre = "GenReina"; }