示例#1
0
        public static void imprimirTabuleiro(TabuleiroClasse tab, bool[,] posicoesPossiveis)
        {
            ConsoleColor fundoOriginal = Console.BackgroundColor;
            ConsoleColor fundoAlterado = 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 = fundoAlterado;
                    }
                    else
                    {
                        Console.BackgroundColor = fundoOriginal;
                    }
                    ImprimirPeca(tab.PecaTab(i, j));
                    Console.BackgroundColor = fundoOriginal;
                }
                Console.WriteLine();
            }
            Console.WriteLine("  a b c d e f g h");
            Console.BackgroundColor = fundoOriginal;
        }
示例#2
0
 public PartidaDeXadrez()
 {
     Tab                 = new TabuleiroClasse(8, 8);
     Turno               = 1;
     JogadorAtual        = Cor.Branca;
     Terminada           = false;
     Xeque               = false;
     VulneravelEnPassant = null;
     Pecas               = new HashSet <Peca>();
     Capturadas          = new HashSet <Peca>();
     ColocarPecas();
 }
示例#3
0
 public static void imprimirTabuleiro(TabuleiroClasse tab)
 {
     for (int i = 0; i < tab.Linhas; i++)
     {
         Console.Write(8 - i + " ");
         for (int j = 0; j < tab.Colunas; j++)
         {
             ImprimirPeca(tab.PecaTab(i, j));
         }
         Console.WriteLine();
     }
     Console.WriteLine("  a b c d e f g h");
 }
示例#4
0
 public Dama(TabuleiroClasse tab, Cor cor) : base(cor, tab)
 {
 }
示例#5
0
 public Torre(TabuleiroClasse tab, Cor cor) : base(cor, tab)
 {
 }
示例#6
0
 public Bispo(TabuleiroClasse tab, Cor cor) : base(cor, tab)
 {
 }
示例#7
0
 public Peao(TabuleiroClasse tab, Cor cor, PartidaDeXadrez partida) : base(cor, tab)
 {
     Partida = partida;
 }
示例#8
0
 public Cavalo(TabuleiroClasse tab, Cor cor) : base(cor, tab)
 {
 }