public static void ImprimirTabuleiro(TabuleiroCod tabuleiro, bool[,] posicoesPossiveis)
        {
            ConsoleColor fundoOriginal = Console.BackgroundColor;
            ConsoleColor fundoAlterado = ConsoleColor.DarkGray;

            for (int i = 0; i < tabuleiro.Linha; i++)
            {
                Console.Write(8 - i + " ");
                for (int j = 0; j < tabuleiro.Coluna; j++)
                {
                    if (posicoesPossiveis[i, j])
                    {
                        Console.BackgroundColor = fundoAlterado;
                    }
                    else
                    {
                        Console.BackgroundColor = fundoOriginal;
                    }
                    ImprimirPeca(tabuleiro.Peca(i, j));
                    Console.BackgroundColor = fundoOriginal;
                }
                Console.WriteLine();
            }
            Console.WriteLine("  a b c d e f g h");
            Console.BackgroundColor = fundoOriginal;
        }
Esempio n. 2
0
 public PartidaDeXadrez()
 {
     Tabuleiro           = new TabuleiroCod(8, 8);
     Turno               = 1;
     JogadorAtual        = Cor.Branca;
     Terminada           = false;
     Xeque               = false;
     Pecas               = new HashSet <Peca>();
     Capturadas          = new HashSet <Peca>();
     VulneravelEnPassant = null;
     ColocarPecas();
 }
 public static void ImprimirTabuleiro(TabuleiroCod tabuleiro)
 {
     for (int i = 0; i < tabuleiro.Linha; i++)
     {
         Console.Write(8 - i + " ");
         for (int j = 0; j < tabuleiro.Coluna; j++)
         {
             ImprimirPeca(tabuleiro.Peca(i, j));
         }
         Console.WriteLine();
     }
     Console.WriteLine("  a b c d e f g h");
 }
 public Bispo(Cor cor, TabuleiroCod tabuleiro) : base(cor, tabuleiro)
 {
 }
Esempio n. 5
0
 public Rei(Cor cor, TabuleiroCod tabuleiro, PartidaDeXadrez partida) : base(cor, tabuleiro)
 {
     Partida = partida;
 }
Esempio n. 6
0
 public Torre(Cor cor, TabuleiroCod tabuleiro) : base(cor, tabuleiro)
 {
 }
 public Cavalo(Cor cor, TabuleiroCod tabuleiro) : base(cor, tabuleiro)
 {
 }
 public Dama(Cor cor, TabuleiroCod tabuleiro) : base(cor, tabuleiro)
 {
 }