Change property name.

This commit is contained in:
Oliver-Akins 2020-10-06 23:17:40 -06:00
parent 05dc6995e5
commit d4d01bf3ac

View file

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