Add: complete JavaDoc for networking, heartbeat, totem flow and game events

This commit is contained in:
MatteoPellegrino05
2026-05-18 18:52:29 +02:00
parent 07e7028ac9
commit e28e7bab6d
26 changed files with 890 additions and 199 deletions
@@ -26,6 +26,9 @@ public class ClientController {
/** Network client (either TCP or RMI) */
private IClient client;
/**
* The username of the client associated with this event.
*/
public String myUsername;
@@ -65,6 +68,11 @@ public class ClientController {
view.setModel(miniModel);
}
/**
* Sets the username of the client associated with this event.
*
* @param username the username to set.
*/
public void setMyUsername (String username) {
this.myUsername=username;
}
@@ -170,7 +178,16 @@ public class ClientController {
}
}
//TODO
/**
* Handles the selection of a totem by the specified player.
*
* <p>If the player is not the current one, an error message is shown.
* Otherwise, the selected totem is retrieved from the available totems
* and the choice is forwarded to the client.
*
* @param playerUsername the username of the player making the choice.
* @param pos the position of the selected totem in the available totems list.
*/
public void totemChoice(String playerUsername,int pos) {
if(!Objects.equals(playerUsername, miniModel.currentState.getCurrentPlayer().getUserName()))
view.showError("It's not your turn!");