Closed captainsano closed 7 years ago
Made the change with if let ..
. _undoMove
seems to already restore the castling rights. What do you mean by undoing the capture?
Sorry, I should've specified. It's been a while since I looked through the code for the project. You're right. I forgot that castling rights were retained in history.
It also may look cleaner to use the isWhite
and isBlack
properties of Color
.
One last thing, the tests on Xcode 7.3 fail to compile: https://travis-ci.org/nvzqz/Sage/jobs/185092484
Done, build passing now!
This does not restore rook castling rights if the capture is undone.
Also, the
if let _ = capture?.kind.isRook {
part passes for any capture. Instead do: