Ejemplo n.º 1
0
        private void AddPromotions(List <Move> moves, Piece toPiece)
        {
            Move move = new Move(Position, toPiece.Position, this, toPiece)
            {
                Promotion = true
            };

            move.AddPromotion(this, new Queen(Color, GameBoard, Index));
            moves.Add(move);

            move = new Move(Position, toPiece.Position, this, toPiece)
            {
                Promotion = true
            };
            move.AddPromotion(this, new Bishop(Color, GameBoard, Index));
            moves.Add(move);

            move = new Move(Position, toPiece.Position, this, toPiece)
            {
                Promotion = true
            };
            move.AddPromotion(this, new Knight(Color, GameBoard, Index));
            moves.Add(move);

            move = new Move(Position, toPiece.Position, this, toPiece)
            {
                Promotion = true
            };
            move.AddPromotion(this, new Rook(Color, GameBoard, Index));
            moves.Add(move);
        }