Initial game class.

This commit is contained in:
Oliver-Akins 2020-09-29 16:39:52 -06:00
parent 169105f400
commit 661f52292e

22
src/utils/Game.ts Normal file
View file

@ -0,0 +1,22 @@
class Game {
readonly code: string;
#_players: players;
public constructor(code: string, host: string) {
this.code = code;
this.#_players = {};
this.add_player(host, true);
};
get players(): players {
return this.#_players;
};
public add_player(player: string, is_host:boolean=false): void {
this.#_players[player] = {
position: undefined,
role: undefined,
host: is_host
};
};
}