diff --git a/server/src/objects/Game.ts b/server/src/objects/Game.ts index d26f042..c3e2e99 100644 --- a/server/src/objects/Game.ts +++ b/server/src/objects/Game.ts @@ -15,7 +15,7 @@ export class Game { public players: Player[]; private _questions: Deck; private _objects: Deck; - private _objectCard: string[]; + private _objectCard: string[]|null; public object: string; @@ -68,7 +68,7 @@ export class Game { } - private parseDeckCSV(conf: config): any { + private parseDeckCSV(conf: config) { /** * Parses out the CSV files and creates the decks for the game to run on * @@ -102,7 +102,7 @@ export class Game { }); }; - private parseDeckGoogleSheets(conf: config): void { + private parseDeckGoogleSheets(conf: config) { /** * Fetches and parses the CSV data from Google Sheets instead of local * CSV files. @@ -112,6 +112,17 @@ export class Game { }; + public resetObject() { + /** + * Resets the objects card, for restarting the game + */ + if (this._objectCard) { + this._objects.discard(this._objectCard); + this._objectCard = null; + }; + }; + + public toJSON(): datastoreGame { /** * Returns a JSON representation of the game.