0
0
Fork 0

Add removePlayers method to cleanly remove all players from the team.

This commit is contained in:
Oliver-Akins 2021-03-15 19:00:06 -06:00
parent d36319e35b
commit 187596ae3a

View file

@ -37,6 +37,27 @@ export class Team {
}; };
/**
* Removes all players from the team.
*/
public removePlayers() {
// Reset the writer
if (this.writer) {
this.writer.team = null;
this.writer.role = null;
this.writer = null;
};
// Reset all the guessers
for (var player of this.guessers) {
player.team = null;
player.role = null;
}
this.guessers = [];
};
/** /**
* Resets all the per-game data related to this team * Resets all the per-game data related to this team
*/ */
@ -44,7 +65,7 @@ export class Team {
this._hand.guesser = []; this._hand.guesser = [];
this._questions = []; this._questions = [];
this._answers = new Array<string>(8).fill(``); this._answers = new Array<string>(8).fill(``);
} };
/** /**