Change property name.
This commit is contained in:
parent
05dc6995e5
commit
d4d01bf3ac
1 changed files with 7 additions and 5 deletions
|
|
@ -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`)
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue