v0.9.5
Class: GameManager
Table of contents
Constructors
Methods
- getAllTables
- getAvailableGames
- getGameDefinition
- getTableById
- getTablesForGame
- registerGame
- removeTable
- unregisterGame
Constructors
constructor
⢠new GameManager(eventBus
, tableFactory
): GameManager
Parameters
Name | Type |
---|---|
eventBus | EventBus |
tableFactory | TableFactory |
Returns
Methods
getAllTables
⸠getAllTables(): Table
[]
Gets all tables in the game manager.
Returns
Table
[]
An array of all tables.
getAvailableGames
⸠getAvailableGames(): GameDefinition
[]
Gets all available games.
Returns
An array of all game definitions.
getGameDefinition
⸠getGameDefinition(gameId
): undefined
| GameDefinition
Gets a game definition by its ID.
Parameters
Name | Type | Description |
---|---|---|
gameId | string | The ID of the game |
Returns
undefined
| GameDefinition
The game definition, or undefined if not found
getTableById
⸠getTableById(tableId
): undefined
| Table
Gets a table by its ID.
Parameters
Name | Type | Description |
---|---|---|
tableId | string | The ID of the table. |
Returns
undefined
| Table
The table, or undefined if not found.
getTablesForGame
⸠getTablesForGame(gameId
): Table
[]
Gets all tables for a game.
Parameters
Name | Type | Description |
---|---|---|
gameId | string | The ID of the game. |
Returns
Table
[]
An array of tables for the game.
registerGame
⸠registerGame(gameDefinition
): void
Registers a game definition.
Parameters
Name | Type | Description |
---|---|---|
gameDefinition | GameDefinition | The game definition to register. |
Returns
void
removeTable
⸠removeTable(tableId
): void
Removes a table from the game manager.
Parameters
Name | Type | Description |
---|---|---|
tableId | string | The ID of the table to remove. |
Returns
void
unregisterGame
⸠unregisterGame(gameId
): void
Unregisters a game definition.
Parameters
Name | Type | Description |
---|---|---|
gameId | string | The ID of the game to unregister. |
Returns
void