Add a status indicator to Game objects

This commit is contained in:
Oliver-Akins 2020-10-01 22:16:10 -06:00
parent 22a76984eb
commit b842d9f8bc

View file

@ -1,10 +1,12 @@
class Game { class Game {
readonly code: string; readonly code: string;
public status: string;
#players: players; #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.add_player(host, true); this.add_player(host, true);
}; };
@ -36,7 +38,7 @@ class Game {
}, undefined, `\t`) }, undefined, `\t`)
}; };
public static fromJSON(data: string): Game { public static fromJSON(data: string): void {
let db: database = JSON.parse(data) as database; let db: database = JSON.parse(data) as database;
}; };
}; };