0
0
Fork 0

Implement fromJSON method

This commit is contained in:
Oliver-Akins 2021-01-07 12:33:10 -07:00
parent ce252d471a
commit b155791f26

View file

@ -68,4 +68,14 @@ export class Deck<T> {
discard: this._discard,
};
};
public static fromJSON<A>(data: datastoreDeck<A>): Deck<A> {
/**
* Converts the JSON representation of a deck into a Deck
*/
let d = new Deck(data.deck);
d._discard = data.discard;
d._unknown = data.unknown;
return d;
};
};