better undo
This commit is contained in:
@@ -4,12 +4,10 @@ public abstract class Piece {
|
||||
|
||||
private final Color color;
|
||||
private int moved;
|
||||
private int ejectedMoveNumber;
|
||||
|
||||
public Piece(Color color) {
|
||||
this.color = color;
|
||||
this.moved = 0;
|
||||
this.ejectedMoveNumber = -1;
|
||||
}
|
||||
|
||||
public void move() {
|
||||
@@ -28,18 +26,6 @@ public abstract class Piece {
|
||||
this.moved--;
|
||||
}
|
||||
|
||||
public boolean isEjected() {
|
||||
return this.ejectedMoveNumber != -1;
|
||||
}
|
||||
|
||||
public int getEjectedMoveNumber() {
|
||||
return ejectedMoveNumber;
|
||||
}
|
||||
|
||||
public void eject(int moveNumber) {
|
||||
this.ejectedMoveNumber = moveNumber;
|
||||
}
|
||||
|
||||
public abstract <T> T accept(PieceVisitor<T> visitor);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user