Add: complete JavaDoc for networking, heartbeat, totem flow and game events
This commit is contained in:
@@ -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!");
|
||||
|
||||
Reference in New Issue
Block a user