You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for this awesome project! Also thanks for making this specific issue, I had the exact same problem and was happy with the solution shown here.
Knowing the solution, I'm honestly quite happy with the current implementation. You can elegantly check the type of move with an is statement and cast it to the specific type (e.g. MovePromotion) to get detailed information (e.g. to which piece the pawn is being promoted). For me this is mainly an issue of documentation. The Parameter property is named very generically and isn't found in the main documentation.
So my suggestion would be to rename the Parameter property to something more intuitive like "SpecialMoveDetails", add a more detailed description than "Move additional parameter", and include a short example in the main documentation on how it can be used to check for move type and get the move details from it.
I found a way to achieve this
move.Parameter is MovePromotion
returnstrue
when the move is a promotion.And to find out what the promoted piece is, I do
And to check whether a move is EnPassant, I do
move.Parameter is MoveEnPassant
I guess this works since a move can't be both En Passant and promotion at the same time. But it's not very straightforward.
It would be nice if the library supported
Move.Promotion
which returns the promoted piece or null when there is no promotion.Also consider adding
Move.IsEnPassant
andMove.IsCastling
Anyways, thanks for the amazing library.
The text was updated successfully, but these errors were encountered: