Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get captured piece after a move? #6

Closed
cesarvarela opened this issue Jul 30, 2016 · 3 comments
Closed

How to get captured piece after a move? #6

cesarvarela opened this issue Jul 30, 2016 · 3 comments

Comments

@cesarvarela
Copy link

cesarvarela commented Jul 30, 2016

First of all, awesome work you have here!

Now, how do I get the captured piece after a move?

I've been looking at the move history, but I wonder if you though about an easier way.

@nvzqz
Copy link
Owner

nvzqz commented Jul 30, 2016

There currently isn't a way to get the captured piece from the last executed move. I'll definitely add this functionality!

What you can do, however is check for a change with capturedPieces(for:). There's also checking the piece at move.end before the move but that won't take en passant into account.

@nvzqz
Copy link
Owner

nvzqz commented Jul 31, 2016

Done afa841e

@nvzqz nvzqz closed this as completed Jul 31, 2016
@nvzqz
Copy link
Owner

nvzqz commented Aug 1, 2016

New release with this change: v2.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants