public static void ImprimeTabuleiro(TabuleiroDoJogo tab, bool[,] posicoesPossiveis)// varre a matriz e imprime o tabuleiro com posicoes possiveis
        {
            ConsoleColor fundoO = Console.BackgroundColor;
            ConsoleColor fundoD = ConsoleColor.DarkGray;

            for (int i = 0; i < tab.linhas; i++)
            {
                Console.Write(8 - i + " ");
                for (int j = 0; j < tab.colunas; j++)
                {
                    if (posicoesPossiveis[i, j])
                    {
                        Console.BackgroundColor = fundoD;
                    }
                    else
                    {
                        Console.BackgroundColor = fundoO;
                    }

                    ImprimirPeca(tab.retornaPeca(i, j));
                    Console.BackgroundColor = fundoO;
                }

                Console.WriteLine();
            }
            Console.WriteLine("  a b c d e f g h \n");
            Console.BackgroundColor = fundoO;
        }
 public PartidaDeXadres()
 {
     tab          = new TabuleiroDoJogo(8, 8);
     turno        = 1;
     jogadorAtual = Cor.Branca;
     pecas        = new HashSet <Peca>();
     capturadas   = new HashSet <Peca>();
     colocarPecas();
     VulneravelEnPassant = null;
     terminada           = false;
     xeque = false;
 }
        public static void ImprimeTabuleiro(TabuleiroDoJogo tab)// varre a matriz e imprime o tabuleiro sem posicoes possiveis
        {
            for (int i = 0; i < tab.linhas; i++)
            {
                Console.Write(8 - i + " ");
                for (int j = 0; j < tab.colunas; j++)
                {
                    ImprimirPeca(tab.retornaPeca(i, j));
                }

                Console.WriteLine();
            }
            Console.WriteLine("  a b c d e f g h \n");
        }
示例#4
0
 public Cavalo(TabuleiroDoJogo tabuleiro, Cor cor) : base(tabuleiro, cor)
 {
 }
示例#5
0
 public Bispo(TabuleiroDoJogo tabuleiro, Cor cor) : base(tabuleiro, cor)
 {
 }
示例#6
0
 public Peao(TabuleiroDoJogo tab, Cor cor, PartidaDeXadres partida) : base(tab, cor)
 {
     this.partida = partida;
 }
示例#7
0
 public Torre(TabuleiroDoJogo tabuleiro, Cor cor) : base(tabuleiro, cor)
 {
 }
示例#8
0
 public Dama(TabuleiroDoJogo tabuleiro, Cor cor) : base(tabuleiro, cor)
 {
 }