diff --git a/src/utils/Game.ts b/src/utils/Game.ts index 1355916..e4d53bb 100644 --- a/src/utils/Game.ts +++ b/src/utils/Game.ts @@ -1,17 +1,19 @@ export class Game { readonly code: string; public status: game_states; - #players: players; + private banned_players: string[]; + private _players: players; public constructor(code: string, host: string) { this.code = code; - this.#players = {}; + this._players = {}; this.status = `lobby`; + this.banned_players = []; this.add_player(host, true); }; get players(): players { - return this.#players; + return this._players; }; get host(): string|null { @@ -24,7 +26,7 @@ export class Game { } public add_player(player: string, is_host:boolean=false): void { - this.#players[player] = { + this._players[player] = { position: undefined, role: undefined, host: is_host, @@ -46,7 +48,7 @@ export class Game { public toJSON(): string { return JSON.stringify({ code: this.code, - players: this.#players, + players: this._players, }, undefined, `\t`) };