Add: complete JavaDoc for networking, heartbeat, totem flow and game events
This commit is contained in:
@@ -30,7 +30,14 @@ public class GameController {
|
||||
*/
|
||||
public GameController() {
|
||||
}
|
||||
//TODO
|
||||
|
||||
/**
|
||||
* Marks the player associated with the specified username as disconnected.
|
||||
*
|
||||
* @param username the username of the player who disconnected.
|
||||
* @return {@code true} if the disconnection is handled successfully,
|
||||
* {@code false} if no player with the specified username exists.
|
||||
*/
|
||||
public boolean DisconnectedPlayer(String username)
|
||||
{
|
||||
Player player= model.getPlayerByUsername(username);
|
||||
@@ -38,7 +45,14 @@ public class GameController {
|
||||
return false;
|
||||
return model.DisconnectedPlayer(player);
|
||||
}
|
||||
//TODO
|
||||
|
||||
/**
|
||||
* Marks the player associated with the specified username as reconnected.
|
||||
*
|
||||
* @param username the username of the player who reconnected.
|
||||
* @return {@code true} if the reconnection is handled successfully,
|
||||
* {@code false} if no player with the specified username exists.
|
||||
*/
|
||||
public boolean ReconnectPlayer(String username)
|
||||
{
|
||||
Player player= model.getPlayerByUsername(username);
|
||||
@@ -46,6 +60,7 @@ public class GameController {
|
||||
return false;
|
||||
return model.ReconnectPlayer(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the game model managed by this controller.
|
||||
*
|
||||
@@ -166,7 +181,14 @@ public class GameController {
|
||||
return model.SlotChoiceByIndex(model.getPlayerByUsername(playerUsername),pos);
|
||||
}
|
||||
|
||||
//TODO
|
||||
/**
|
||||
* Applies the totem choice made by the player associated with the specified username.
|
||||
*
|
||||
* @param playerUsername the username of the player making the choice.
|
||||
* @param totem the name of the selected totem.
|
||||
* @return {@code true} if the choice is handled successfully,
|
||||
* {@code false} if no player with the specified username exists.
|
||||
*/
|
||||
public boolean TotemChoice(String playerUsername,String totem) {
|
||||
Player player= model.getPlayerByUsername(playerUsername);
|
||||
if(player==null)
|
||||
|
||||
Reference in New Issue
Block a user