Ejemplo n.º 1
0
        public static void ImprimirTabuleiro(Tabuleiro.Tabuleiro tabuleiro, bool[,] posicoesPossiveis)
        {
            ConsoleColor originalBackground = Console.BackgroundColor;
            ConsoleColor alteredBackground  = ConsoleColor.DarkGray;

            for (int i = 0; i < tabuleiro.Linhas; i++)
            {
                Console.BackgroundColor = originalBackground;
                Console.Write($"{8 - i} ");

                for (int j = 0; j < tabuleiro.Colunas; j++)
                {
                    if (posicoesPossiveis[i, j])
                    {
                        Console.BackgroundColor = alteredBackground;
                    }

                    ImprimirPeca(tabuleiro.GetPeca(i, j));

                    if (Console.BackgroundColor != originalBackground)
                    {
                        Console.BackgroundColor = originalBackground;
                    }
                }

                Console.WriteLine();
            }

            Console.BackgroundColor = originalBackground;
            Console.WriteLine("  a b c d e f g h");
        }
Ejemplo n.º 2
0
 public PartidaDeXadrez()
 {
     tab          = new Tabuleiro.Tabuleiro(8, 8);
     turno        = 1;
     jogadorAtual = Cor.Branca;
     pecas        = new HashSet <Peca>();
     capturadas   = new HashSet <Peca>();
     xeque        = false;
     colocarPecas();
     terminada          = false;
     vuneravelEnPassant = null;
 }
Ejemplo n.º 3
0
 public PartidaDeXadrez()
 {
     tab                 = new Tabuleiro.Tabuleiro(8, 8);
     Turno               = 1;
     JogadorAtual        = Cor.Branca;
     Terminada           = false;
     Cheque              = false;
     VulneravelEnPassant = null;
     Pecas               = new HashSet <Peca>();
     Capturadas          = new HashSet <Peca>();
     ColocarPecas();
 }
Ejemplo n.º 4
0
        public PartidaDeXadrez()
        {
            Tabuleiro    = new Tabuleiro.Tabuleiro(8, 8);
            Terminada    = false;
            Turno        = 1;
            JogadorAtual = Cor.Branco;
            Xeque        = false;

            _pecas           = new HashSet <Peca>();
            _pecasCapturadas = new HashSet <Peca>();

            ColocarPecas();
        }
Ejemplo n.º 5
0
        public static void ImprimirTabuleiro(Tabuleiro.Tabuleiro tabuleiro)
        {
            for (int i = 0; i < tabuleiro.Linhas; i++)
            {
                Console.Write($"{8 - i} ");
                for (int j = 0; j < tabuleiro.Colunas; j++)
                {
                    ImprimirPeca(tabuleiro.GetPeca(i, j));
                }

                Console.WriteLine();
            }

            Console.WriteLine("  a b c d e f g h");
        }
Ejemplo n.º 6
0
        // Inicia a partida
        public PartidaDeXadrez()
        {
            // Coloca o tabuleiro
            tab = new Tabuleiro.Tabuleiro(8, 8);

            turno              = 1;
            jogadorAtual       = Cor.Branca;
            terminada          = false;
            vuneravelEnPassant = null;
            pecas              = new HashSet <Peca>();
            capturadas         = new HashSet <Peca>();

            //Coloca as peças no tabuleiro
            colocarPecas();
        }
Ejemplo n.º 7
0
 public Rei(Tabuleiro.Tabuleiro tabuleiro, CorEnum cor) : base(tabuleiro, cor)
 {
 }
Ejemplo n.º 8
0
 public Cavalo(Tabuleiro.Tabuleiro tab, Cor cor) : base(tab, cor)
 {
 }
Ejemplo n.º 9
0
 public Rainha(Tabuleiro.Tabuleiro tabuleiro, Cor cor) : base(tabuleiro, cor)
 {
 }
Ejemplo n.º 10
0
 public Peao(Tabuleiro.Tabuleiro tab, Cor cor, PartidaDeXadrez partida)
     : base(tab, cor)
 {
     Partida = partida;
 }
Ejemplo n.º 11
0
 public Dama(Tabuleiro.Tabuleiro tabuleiro, CorEnum cor) : base(tabuleiro, cor)
 {
 }
Ejemplo n.º 12
0
 public Cavalo(Tabuleiro.Tabuleiro tabuleiro, CorEnum cor) : base(tabuleiro, cor)
 {
 }
Ejemplo n.º 13
0
 public Torre(Tabuleiro.Tabuleiro tabuleiro, CorEnum cor) : base(tabuleiro, cor)
 {
 }
Ejemplo n.º 14
0
 public Dama(Tabuleiro.Tabuleiro tab, Cor cor)
     : base(tab, cor)
 {
 }
Ejemplo n.º 15
0
 public Peao(Tabuleiro.Tabuleiro tabuleiro, Cor cor) : base(tabuleiro, cor)
 {
 }
Ejemplo n.º 16
0
 public Bispo(Tabuleiro.Tabuleiro tabuleiro, Cor cor) : base(tabuleiro, cor)
 {
 }
Ejemplo n.º 17
0
 public Rei(Tabuleiro.Tabuleiro tab, Cor cor, PartidaDeXadrez partida) : base(tab, cor)
 {
     this.partida = partida;
 }
Ejemplo n.º 18
0
 public Torre(Tabuleiro.Tabuleiro tab, Cor cor)
     : base(tab, cor)
 {
 }