Implement a toJSON function.
This commit is contained in:
parent
cc10c145b5
commit
95c298002f
1 changed files with 12 additions and 0 deletions
|
|
@ -56,4 +56,16 @@ export class Deck<T> {
|
|||
this._unknown = this._unknown.filter(x => x != card);
|
||||
this._discard.push(card);
|
||||
};
|
||||
|
||||
|
||||
public toJSON(): datastoreDeck<T> {
|
||||
/**
|
||||
* Converts this Deck into a JSON-compatible object
|
||||
*/
|
||||
return {
|
||||
deck: this._deck,
|
||||
unknown: this._unknown,
|
||||
discard: this._discard,
|
||||
};
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue