public class SimpleGameAdminService extends Object implements GameAdminService
Modifier and Type | Field and Description |
---|---|
private Collection<Game> |
games |
Constructor and Description |
---|
SimpleGameAdminService() |
Modifier and Type | Method and Description |
---|---|
Collection<Game> |
getGames() |
Object |
loadGame(long gameId,
String gameName)
Loads a game based on the game id OR game name.
|
Object |
loadGameRoom(Game game,
long gameRoomId,
String gameRoomName)
Loads a game room based on the game room id OR game name.
|
boolean |
registerGame(Game game)
Implementation method will internally add this game instance to a set.
|
void |
setGames(Collection<Game> games) |
void |
shutdown()
Unloads all the games and game rooms that is stored in the admin services
internal set.
|
Object |
unLoadGame(Game game)
Unloads a game based on the game instance passed in.
|
Object |
unLoadGame(long gameId,
String gameName)
Unloads a game based on the game id OR game name.
|
Object |
unloadGameRoom(Game game,
long gameRoomId)
Unloads a game room of a game based on the instance of the game, the
unique identifier of the game room or the string game room name.
|
void |
unloadGameRoom(GameRoom gameRoom)
Unloads a game room based on the game room instance passed in.
|
Object |
unloadGameRoom(Game game,
String gameRoomId)
Unloads a game room of a game based on the instance of the game and the
name of the game room.
|
private Collection<Game> games
public boolean registerGame(Game game)
GameAdminService
registerGame
in interface GameAdminService
game
- The game instance to register with the admin service.public Object loadGame(long gameId, String gameName)
GameAdminService
loadGame
in interface GameAdminService
gameId
- The unique number identifier for the game. Most probably a
database key.gameName
- The unique name for a game.public Object loadGameRoom(Game game, long gameRoomId, String gameRoomName)
GameAdminService
loadGameRoom
in interface GameAdminService
game
- The game for which the game room need to be loaded.gameRoomId
- The unique identifier for the game room. Most probably a
database id.gameRoomName
- The name of the game room to load.public Object unLoadGame(long gameId, String gameName)
GameAdminService
GameRoom
s or PlayerSession
s associated
with this game.unLoadGame
in interface GameAdminService
gameId
- The unique number identifier for the game. Most probably a
database key.gameName
- The unique name for a game.public Object unLoadGame(Game game)
GameAdminService
GameRoom
s or
PlayerSession
s associated with this game.unLoadGame
in interface GameAdminService
game
- The instance of the game to unload.public void unloadGameRoom(GameRoom gameRoom)
GameAdminService
PlayerSession
s associated with this game room.unloadGameRoom
in interface GameAdminService
gameRoom
- The game room instance which is to be unloaded.public Object unloadGameRoom(Game game, long gameRoomId)
GameAdminService
PlayerSession
s associated with this game room.unloadGameRoom
in interface GameAdminService
game
- The instance of the game for which the game room needs to be
removed.gameRoomId
- The unique identifier for the game room. Most probably a
database id.public Object unloadGameRoom(Game game, String gameRoomId)
GameAdminService
PlayerSession
s associated with this game room.unloadGameRoom
in interface GameAdminService
game
- The instance of the game for which the game room needs to be
removedgameRoomId
- The name of the game room to unload.public void shutdown()
GameAdminService
shutdown
in interface GameAdminService
public Collection<Game> getGames()
public void setGames(Collection<Game> games)
Copyright © 2013. All Rights Reserved.