|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.asdf.client.LobbyModel
public class LobbyModel
Bookkeeping class used by LobbyController. Keeps up to date information about which game is selected in lobby, which game type is selected and also the current gamelist. Also includes getter methods which are useful for getting actual class names of selected games create game panels and game clients.
Constructor Summary | |
---|---|
LobbyModel()
Sole constructor. |
Method Summary | |
---|---|
void |
addGame(GameController game)
Adds a game to the list of started game clients. |
AvailableGamesResponse |
getAvailableGames()
Gets available games. |
java.lang.String |
getCreatePanelName(java.lang.String gameType)
Gives the class name of the CreateGamePanel for this game type which is shown in lobby. |
java.lang.String |
getGameControllerName(java.lang.String gameType)
Gives the class name of the GameController for this game type which starts the game client at client side. |
GameListResponse |
getGameList()
Gets listed games. |
java.lang.String |
getListedCreatePanelName()
Gives the class name of the CreateGamePanel for listed game type which is shown in lobby. |
java.lang.String |
getListedGameControllerName()
Gives the class name of the GameController for listed game type which starts the game client at client side. |
java.lang.String |
getListedGameType()
Gets the game type which is listed. |
java.lang.String |
getListedGameVariant()
Gets the game variant which is listed. |
java.lang.String |
getListedServerGameName()
Gives the class name of the Game running on server side for listed game type which is shown in lobby. |
long |
getSelectedGame()
Gets the id of selected game. |
java.lang.String |
getServerGameName(java.lang.String gameType)
Gives the class name of the Game running on server side for listed game type which is shown in lobby. |
User |
getUser()
Gets the user object. |
void |
setAvailableGames(AvailableGamesResponse response)
Sets list of available games given by server. |
void |
setGameList(GameListResponse response)
Sets games listed in lobby. |
void |
setListedGame(java.lang.String gameName,
java.lang.String variant)
Sets the type and variant of listed game. |
void |
setLoggedIn(java.lang.String name,
double balance,
AccountType type)
Sets user logged in. |
void |
setLoggedOut()
Sets user logged out. |
void |
setSelectedGame(long id)
Sets the id of selected game. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LobbyModel()
Method Detail |
---|
public void setListedGame(java.lang.String gameName, java.lang.String variant)
gameName
- variant
- public User getUser()
public void setSelectedGame(long id)
id
- GameID of selected game.public long getSelectedGame()
public java.lang.String getListedGameType()
public java.lang.String getListedGameVariant()
public java.lang.String getListedGameControllerName()
public java.lang.String getGameControllerName(java.lang.String gameType)
gameType
- Game type name.
public java.lang.String getListedCreatePanelName()
public java.lang.String getCreatePanelName(java.lang.String gameType)
gameType
- Game type name.
public java.lang.String getListedServerGameName()
public java.lang.String getServerGameName(java.lang.String gameType)
gameType
- Game type name.
public void addGame(GameController game)
game
- Game which was started in lobby.public void setLoggedIn(java.lang.String name, double balance, AccountType type)
name
- Account name.balance
- Account balance.type
- Account type. See AccounType enumeration for details.public void setLoggedOut()
public void setGameList(GameListResponse response)
response
- GameListResponse sent by server.public void setAvailableGames(AvailableGamesResponse response)
response
- AvailableGamesResponse sent by server.public GameListResponse getGameList()
public AvailableGamesResponse getAvailableGames()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |