Fix: Game
This commit is contained in:
@@ -36,6 +36,12 @@ public class Game implements Serializable {
|
|||||||
o.update(this);
|
o.update(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* The current number of players.
|
||||||
|
*/
|
||||||
|
public int getCurrentPlayerNumber() {
|
||||||
|
return playersList.size();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The list of players participating in the game.
|
* The list of players participating in the game.
|
||||||
@@ -189,7 +195,7 @@ public class Game implements Serializable {
|
|||||||
}
|
}
|
||||||
if(currentState.getGameStage()!= GameStages.WAITING)
|
if(currentState.getGameStage()!= GameStages.WAITING)
|
||||||
return false;
|
return false;
|
||||||
if(playersList.contains(player))
|
if(playersList.stream().anyMatch(player.getUserName()::equals))
|
||||||
return false;
|
return false;
|
||||||
playersList.add(player);
|
playersList.add(player);
|
||||||
if(playersList.size()>=nPlayers)
|
if(playersList.size()>=nPlayers)
|
||||||
|
|||||||
Reference in New Issue
Block a user