Refactor of network stack
This commit is contained in:
@@ -40,12 +40,12 @@ public class GameController {
|
||||
* {@code false} if no player with the specified username exists
|
||||
* or if the operation fails.
|
||||
*/
|
||||
public synchronized boolean DisconnectedPlayer(String username)
|
||||
public synchronized boolean disconnectedPlayer(String username)
|
||||
{
|
||||
Player player= model.getPlayerByUsername(username);
|
||||
if(player==null)
|
||||
return false;
|
||||
return model.DisconnectedPlayer(player);
|
||||
return model.disconnectedPlayer(player);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,12 +56,12 @@ public class GameController {
|
||||
* {@code false} if no player with the specified username exists
|
||||
* or if the operation fails.
|
||||
*/
|
||||
public synchronized boolean ReconnectPlayer(String username)
|
||||
public synchronized boolean reconnectPlayer(String username)
|
||||
{
|
||||
Player player= model.getPlayerByUsername(username);
|
||||
if(player==null)
|
||||
return false;
|
||||
return model.ReconnectPlayer(player);
|
||||
return model.reconnectPlayer(player);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -165,11 +165,11 @@ public class GameController {
|
||||
* @return {@code true} if the skip action is valid and successfully performed,
|
||||
* {@code false} if the player does not exist or if the action is not valid.
|
||||
*/
|
||||
public synchronized boolean SkipTurn(String playerUsername) {
|
||||
public synchronized boolean skipTurn(String playerUsername) {
|
||||
Player player= model.getPlayerByUsername(playerUsername);
|
||||
if(player==null)
|
||||
return false;
|
||||
return model.SkipTurn(model.getPlayerByUsername(playerUsername));
|
||||
return model.skipTurn(model.getPlayerByUsername(playerUsername));
|
||||
}
|
||||
|
||||
|
||||
@@ -199,15 +199,17 @@ public class GameController {
|
||||
* {@code false} if no player with the specified username exists
|
||||
* or if the choice operation fails.
|
||||
*/
|
||||
public synchronized boolean TotemChoice(String playerUsername,String totem) {
|
||||
public synchronized boolean totemChoice(String playerUsername,String totem) {
|
||||
Player player= model.getPlayerByUsername(playerUsername);
|
||||
if(player==null)
|
||||
return false;
|
||||
return model.TotemChoice(player, Totems.valueOf(totem));
|
||||
return model.totemChoice(player, Totems.valueOf(totem));
|
||||
}
|
||||
|
||||
//TODO
|
||||
public synchronized void EndGameForFeit(){
|
||||
model.EndGameForFeit();
|
||||
@Deprecated
|
||||
public synchronized void EndGameForFeit() { endGameForFeit(); }
|
||||
|
||||
public synchronized void endGameForFeit() {
|
||||
model.endGameForFeit();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user