Class GameInfo
java.lang.Object
it.polimi.ingsw.eriantys.controller.GameInfo
- All Implemented Interfaces:
Serializable
This class contains all the relevant information about a
Game
. Objects of this class are meant to be included
in messages between the server and the clients in order to provide updates about the game lobby, and to be used by
classes which need information about the game object.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the creator of the referenced game.int
Returns the number of players currently participating in the referenced game.int
Returns the id of the referenced game.int
Returns the number of players expected to participate in the referenced game.boolean
Returnstrue
if and only if the game is in expert mode.void
setCurrentPlayers
(int currentPlayers) Sets the number of players currently participating in the referenced game to the specified value.toString()
-
Constructor Details
-
GameInfo
Constructs an instance ofGameInfo
with the specified parameters.- Parameters:
gameId
- the id of the referencedGame
.creator
- the creator of the referenced game.lobbySize
- the number of players expected to participate in the referenced game.expertMode
- a flag specifying whether the referenced game is in expert mode.
-
-
Method Details
-
getGameId
public int getGameId()Returns the id of the referenced game.- Returns:
- the id of the referenced game.
-
getLobbySize
public int getLobbySize()Returns the number of players expected to participate in the referenced game.- Returns:
- the number of players expected to participate in the referenced game.
-
getCurrentPlayers
public int getCurrentPlayers()Returns the number of players currently participating in the referenced game.- Returns:
- the number of players currently participating in the referenced game.
-
setCurrentPlayers
public void setCurrentPlayers(int currentPlayers) Sets the number of players currently participating in the referenced game to the specified value.- Parameters:
currentPlayers
- the new value for the current players.
-
isExpertMode
public boolean isExpertMode()Returnstrue
if and only if the game is in expert mode.- Returns:
true
if and only if the game is in expert mode.
-
getCreator
Returns the creator of the referenced game.- Returns:
- the creator of the referenced game.
-
toString
-