From 05dc6995e5e57ca64ffdc982de2607fb1aab068e Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Tue, 6 Oct 2020 23:17:12 -0600 Subject: [PATCH] Add remove_player method. --- src/utils/Game.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/utils/Game.ts b/src/utils/Game.ts index aa3ad3f..1355916 100644 --- a/src/utils/Game.ts +++ b/src/utils/Game.ts @@ -27,7 +27,14 @@ export class Game { this.#players[player] = { position: undefined, role: undefined, - host: is_host + host: is_host, + }; + }; + + public remove_player(player: string, ban: boolean): void { + delete this._players[player]; + if (ban) { + this.banned_players.push(player); }; };