I don't know whether it is deliberate for not adding the code self.enPassantTarget = game.enPassantTarget.
But not adding this line will cause the following issue:
Let's suppose a game A is in an "En Passant" state, that is, the next player who moves the piece can make an en passant move. Apparently, calling myGame.isLegal(move: myEnPassantMove) will return true. But if we call myGame.copy().isLegal(move: myEnPassantMove), it will return false which is not act as "expected".
I don't know whether it is deliberate for not adding the code
self.enPassantTarget = game.enPassantTarget
. But not adding this line will cause the following issue:Let's suppose a game A is in an "En Passant" state, that is, the next player who moves the piece can make an en passant move. Apparently, calling
myGame.isLegal(move: myEnPassantMove)
will returntrue
. But if we callmyGame.copy().isLegal(move: myEnPassantMove)
, it will returnfalse
which is not act as "expected".