Add reset method.
This commit is contained in:
parent
8e5cc3a612
commit
d2760c6a26
1 changed files with 14 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue