added the method tryMove and the methods used by it into serverstate

This commit is contained in:
Hanno Fleischer
2024-11-17 17:52:25 +01:00
parent 9662e1f684
commit 90fb6e4133
4 changed files with 174 additions and 1 deletions

View File

@@ -6,7 +6,7 @@
public class Piece {
private ShieldState shield;
private PieceState state;
private Color color;
private final Color color;
/**
* This constructor is used to create a new Piece
@@ -73,4 +73,13 @@ public boolean isShielded() {
public boolean isSuppressed() {
return shield == ShieldState.SUPPRESSED;
}
/**
* This method is used to get the color of the piece
*
* @return the color of the piece
*/
public Color getColor() {
return color;
}
}