en passant rule
This commit is contained in:
@@ -4,6 +4,7 @@ import java.util.EmptyStackException;
|
||||
import java.util.Stack;
|
||||
|
||||
import chess.controller.PlayerCommand;
|
||||
import chess.controller.commands.MoveCommand;
|
||||
import chess.model.visitor.PawnIdentifier;
|
||||
|
||||
public class Game {
|
||||
@@ -99,4 +100,14 @@ public class Game {
|
||||
}
|
||||
}
|
||||
|
||||
public void updateLastMove() {
|
||||
if (this.movesHistory.isEmpty())
|
||||
return;
|
||||
|
||||
PlayerCommand last = this.movesHistory.getLast();
|
||||
if (last instanceof MoveCommand move) {
|
||||
this.board.setLastMove(move.getMove());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user