remove PawnIdentifier
This commit is contained in:
@@ -9,9 +9,9 @@ import chess.model.Game;
|
||||
import chess.model.Piece;
|
||||
import chess.model.pieces.Bishop;
|
||||
import chess.model.pieces.Knight;
|
||||
import chess.model.pieces.Pawn;
|
||||
import chess.model.pieces.Queen;
|
||||
import chess.model.pieces.Rook;
|
||||
import chess.model.visitor.PawnIdentifier;
|
||||
|
||||
public class PromoteCommand extends PlayerCommand {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class PromoteCommand extends PlayerCommand {
|
||||
return CommandResult.NotAllowed;
|
||||
|
||||
Piece pawn = board.pieceAt(this.pieceCoords);
|
||||
if (!new PawnIdentifier(game.getPlayerTurn()).isPawn(pawn))
|
||||
if (!(pawn instanceof Pawn))
|
||||
return CommandResult.NotAllowed;
|
||||
|
||||
int destY = this.pieceCoords.getY();
|
||||
|
||||
Reference in New Issue
Block a user