basic model

This commit is contained in:
2025-03-25 22:36:28 +01:00
parent dc2ea660ff
commit 0bef89c46f
16 changed files with 688 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
package chess.model;
public abstract class Piece {
private final Color color;
private boolean moved;
public Piece(Color color) {
this.color = color;
this.moved = false;
}
public void move() {
this.moved = true;
}
public Color getColor() {
return color;
}
public boolean hasMoved() {
return moved;
}
public void eject() {
// for later
}
public abstract <T> T accept(PieceVisitor<T> visitor);
}