From 526e063eed2d526ffb3c26da271221de6ed0ad83 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sun, 28 Feb 2021 19:37:39 -0700 Subject: [PATCH] Update all manipulations of the hand to use the proper data --- server/src/objects/Team.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/server/src/objects/Team.ts b/server/src/objects/Team.ts index 80a6183..efa3e9f 100644 --- a/server/src/objects/Team.ts +++ b/server/src/objects/Team.ts @@ -21,7 +21,8 @@ export class Team { /* The getters for the various class properties */ - get hand(): string[] { return this._hand; }; + get hand(): string[] { return this._hand.guesser; }; + get spiritHand(): string[] { return this._hand.writer }; get answers(): string[] { return this._answers; }; get questions(): string[] { return this._questions; }; @@ -32,7 +33,7 @@ export class Team { * @param questions The array of question text to add the medium's hand. */ public addCardsToHand(questions: string[]): void { - this._hand.push(...questions); + this._hand.guesser.push(...questions); }; @@ -40,18 +41,20 @@ export class Team { * Resets all the per-game data related to this team */ public reset(): void { - this._hand = []; + this._hand.guesser = []; this._questions = []; this._answers = new Array(8).fill(``); } /** - * Removes the given question from the medium's hand + * Removes a card from the medium's hand * - * @param question The card text to remove from the hand. + * @param question The card to remove */ public removeCard(question: string) { + this._hand.guesser = this._hand.guesser.filter(x => x != question); + }; /** @@ -72,6 +75,7 @@ export class Team { */ public selectQuestion(question: string) { this._questions.push(question); + this._hand.writer = []; };