Esempio n. 1
0
        public static void imprimirTabula(Tabula tab, bool[,] matrizpossivel)
        {
            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 (matrizpossivel[i, j])
                    {
                        Console.BackgroundColor = fundoAlterado;
                    }
                    else
                    {
                        Console.BackgroundColor = fundoOriginal;
                    }
                    imprimirPeca(tab.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 Peca(Tabula tabu, Cor cor)
 {
     this.posicao       = null;
     this.tabu          = tabu;
     this.cor           = cor;
     this.qteMovimentos = 0;
 }
Esempio n. 3
0
 public PartidaDeXadrez() // construindo a partida de xadrez (construtor)
 {
     tab               = new Tabula(8, 8);
     turno             = 1;
     jogadorAtual      = Cor.Branca;
     terminada         = false;
     xeque             = false;
     vulneralEnPassant = null;
     pecas             = new HashSet <Peca>();
     capturadas        = new HashSet <Peca>();
     colocarPecas();
 }
Esempio n. 4
0
 public static void imprimirTabula(Tabula tab) // statica faz com os métodos possam ser chamados a partir da classe, sem necessitar de instanciação de objeto
 {
     for (int i = 0; i < tab.linhas; i++)
     {
         Console.Write(8 - i + " ");
         for (int j = 0; j < tab.colunas; j++)
         {
             imprimirPeca(tab.peca(i, j));
         }
         Console.WriteLine();
     }
     Console.WriteLine("  a b c d e f g h");
 }
Esempio n. 5
0
 public Bispo(Tabula tab, Cor cor) : base(tab, cor)
 {
 }
Esempio n. 6
0
 public Cavalo(Tabula tab, Cor cor) : base(tab, cor)
 {
 }
Esempio n. 7
0
 public Torre(Tabula tab, Cor cor) : base(tab, cor)
 {
 }
Esempio n. 8
0
 public Peao(Tabula tab, Cor cor, PartidaDeXadrez partida) : base(tab, cor)
 {
     this.partida = partida;
 }
Esempio n. 9
0
 public Rainha(Tabula tab, Cor cor) : base(tab, cor)
 {
 }