v0.10.0

Class: TableFactory

Factory class for creating tables. This class is responsible for creating new tables and emitting events when tables are created.

It is exposed as part of the createGameServer function in the index.ts file, and can be used to create new tables. Client functionality for this is already natively handled by the lobby command namespace. (Client Commands)

Table of contents

Constructors

Methods

Constructors

constructor

new TableFactory(eventBus): TableFactory

Parameters

Name Type
eventBus EventBus

Returns

TableFactory

Methods

createTable

createTable(«destructured»): Table

Creates a new table with the specified number of seats and maximum seats per player. Emits a TABLE_EVENTS.CREATED event when the table is created.

Parameters

Name Type
«destructured» Object
› gameId? string
› id? string
› maxSeatsPerPlayer number
› options? Record<string, unknown>
› totalSeats number

Returns

Table

The newly created table.