0
0
Fork 0

Implement a toJSON function.

This commit is contained in:
Oliver-Akins 2021-01-06 17:17:34 -07:00
parent cc10c145b5
commit 95c298002f

View file

@ -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,
};
};
};