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[];
|
public players: Player[];
|
||||||
private _questions: Deck<question_deck>;
|
private _questions: Deck<question_deck>;
|
||||||
private _objects: Deck<object_deck>;
|
private _objects: Deck<object_deck>;
|
||||||
private _objectCard: string[];
|
private _objectCard: string[]|null;
|
||||||
public object: string;
|
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
|
* 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
|
* Fetches and parses the CSV data from Google Sheets instead of local
|
||||||
* CSV files.
|
* 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 {
|
public toJSON(): datastoreGame {
|
||||||
/**
|
/**
|
||||||
* Returns a JSON representation of the game.
|
* Returns a JSON representation of the game.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue