added message contents to the messages

addedn the conentents for all messages regarding the BPMN diagramm and own interpretation.
also created an identifier for pieces to be used for network communication between server and client so that they talk about the same piece.
This commit is contained in:
Fleischer Hanno
2024-11-23 12:26:20 +01:00
parent 89232901a7
commit 806f0d7d9d
21 changed files with 398 additions and 4 deletions

View File

@@ -405,4 +405,17 @@ public void notifyObservers() {
observer.update();
}
}
/**
* This method returns the piece through its identifier.
*
* @param identifier the identifier of the piece
* @return the piece
*/
public Piece getPieceThroughIdentifier(String identifier) {
String[] parts = identifier.split("-");
Color color = Color.valueOf(parts[0]);
int index = Integer.parseInt(parts[1]);
return board.getPlayerData().get(color).getPieces()[index];
}
}