Пример #1
0
        private void AddBlackPieces()
        {
            var fields = BoardController.FieldControllers;

            var rook1 = new PieceController(new Rook(), Black, fields[0, 7]);
            var rook2 = new PieceController(new Rook(), Black, fields[7, 7]);

            var knight1 = new PieceController(new Knight(), Black, fields[1, 7]);
            var knight2 = new PieceController(new Knight(), Black, fields[6, 7]);

            var bishop1 = new PieceController(new Bishop(), Black, fields[2, 7]);
            var bishop2 = new PieceController(new Bishop(), Black, fields[5, 7]);

            var queen = new PieceController(new Queen(), Black, fields[3, 7]);
            var king  = new PieceController(new King(), Black, fields[4, 7]);

            var pawn1 = new PieceController(new Pawn(), Black, fields[0, 6]);
            var pawn2 = new PieceController(new Pawn(), Black, fields[1, 6]);
            var pawn3 = new PieceController(new Pawn(), Black, fields[2, 6]);
            var pawn4 = new PieceController(new Pawn(), Black, fields[3, 6]);
            var pawn5 = new PieceController(new Pawn(), Black, fields[4, 6]);
            var pawn6 = new PieceController(new Pawn(), Black, fields[5, 6]);
            var pawn7 = new PieceController(new Pawn(), Black, fields[6, 6]);
            var pawn8 = new PieceController(new Pawn(), Black, fields[7, 6]);

            Black.AddPiece(rook1);
            Black.AddPiece(rook2);
            Black.AddPiece(knight1);
            Black.AddPiece(knight2);
            Black.AddPiece(bishop1);
            Black.AddPiece(bishop2);
            Black.AddPiece(queen);
            Black.AddPiece(king);
            Black.AddPiece(pawn1);
            Black.AddPiece(pawn2);
            Black.AddPiece(pawn3);
            Black.AddPiece(pawn4);
            Black.AddPiece(pawn5);
            Black.AddPiece(pawn6);
            Black.AddPiece(pawn7);
            Black.AddPiece(pawn8);
        }
Пример #2
0
        private void AddWhitePieces()
        {
            var fields = BoardController.FieldControllers;

            var rook1 = new PieceController(new Rook(), White, fields[0, 0]);
            var rook2 = new PieceController(new Rook(), White, fields[7, 0]);

            var knight1 = new PieceController(new Knight(), White, fields[1, 0]);
            var knight2 = new PieceController(new Knight(), White, fields[6, 0]);

            var bishop1 = new PieceController(new Bishop(), White, fields[2, 0]);
            var bishop2 = new PieceController(new Bishop(), White, fields[5, 0]);

            var queen = new PieceController(new Queen(), White, fields[3, 0]);
            var king  = new PieceController(new King(), White, fields[4, 0]);

            var pawn1 = new PieceController(new Pawn(), White, fields[0, 1]);
            var pawn2 = new PieceController(new Pawn(), White, fields[1, 1]);
            var pawn3 = new PieceController(new Pawn(), White, fields[2, 1]);
            var pawn4 = new PieceController(new Pawn(), White, fields[3, 1]);
            var pawn5 = new PieceController(new Pawn(), White, fields[4, 1]);
            var pawn6 = new PieceController(new Pawn(), White, fields[5, 1]);
            var pawn7 = new PieceController(new Pawn(), White, fields[6, 1]);
            var pawn8 = new PieceController(new Pawn(), White, fields[7, 1]);

            White.AddPiece(rook1);
            White.AddPiece(rook2);
            White.AddPiece(knight1);
            White.AddPiece(knight2);
            White.AddPiece(bishop1);
            White.AddPiece(bishop2);
            White.AddPiece(queen);
            White.AddPiece(king);
            White.AddPiece(pawn1);
            White.AddPiece(pawn2);
            White.AddPiece(pawn3);
            White.AddPiece(pawn4);
            White.AddPiece(pawn5);
            White.AddPiece(pawn6);
            White.AddPiece(pawn7);
            White.AddPiece(pawn8);
        }