0
0
Fork 0

Add reset method.

This commit is contained in:
Oliver-Akins 2021-01-07 18:15:57 -07:00
parent 8e5cc3a612
commit d2760c6a26

View file

@ -15,7 +15,7 @@ export class Game {
public players: Player[];
private _questions: Deck<question_deck>;
private _objects: Deck<object_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.