Add getter for host of the game

This commit is contained in:
Oliver-Akins 2020-10-06 23:16:36 -06:00
parent 86199d71d5
commit bdb7f6fc14

View file

@ -14,6 +14,15 @@ export class Game {
return this.#players; return this.#players;
}; };
get host(): string|null {
for (var player in this._players) {
if (this._players[player].host) {
return player;
};
};
return null;
}
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,