Пример #1
0
        internal void SetUpPieces()
        {
            Board.Clear();
            moves.Clear();
            prevHashes.Clear();
            progress.Clear();
            CurrentTurn = PieceColor.White;

            for (int i = 0; i < 8; i++)
            {
                Board.AddPiece(1, i, new Pawn(PieceColor.Black, Board, i));
                Board.AddPiece(6, i, new Pawn(PieceColor.White, Board, i));
            }

            Board.AddPiece(0, 0, new Rook(PieceColor.Black, Board, 8));
            Board.AddPiece(0, 7, new Rook(PieceColor.Black, Board, 9));
            Board.AddPiece(7, 0, new Rook(PieceColor.White, Board, 8));
            Board.AddPiece(7, 7, new Rook(PieceColor.White, Board, 9));

            Board.AddPiece(0, 1, new Knight(PieceColor.Black, Board, 10));
            Board.AddPiece(0, 6, new Knight(PieceColor.Black, Board, 11));
            Board.AddPiece(7, 1, new Knight(PieceColor.White, Board, 10));
            Board.AddPiece(7, 6, new Knight(PieceColor.White, Board, 11));

            Board.AddPiece(0, 2, new Bishop(PieceColor.Black, Board, 12));
            Board.AddPiece(0, 5, new Bishop(PieceColor.Black, Board, 13));
            Board.AddPiece(7, 2, new Bishop(PieceColor.White, Board, 12));
            Board.AddPiece(7, 5, new Bishop(PieceColor.White, Board, 13));

            Board.AddPiece(0, 3, new Queen(PieceColor.Black, Board, 14));
            Board.AddPiece(7, 3, new Queen(PieceColor.White, Board, 14));

            Board.AddPiece(0, 4, new King(PieceColor.Black, Board, 15));
            Board.AddPiece(7, 4, new King(PieceColor.White, Board, 15));

            MidGame = true;

            prevHashes.Push(Board.Hash);

            chessView.UpdateVisual(Board);
        }