From 8e5cc3a6122cbdd72ca87a01b3621c4807222c42 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Thu, 7 Jan 2021 18:15:41 -0700 Subject: [PATCH] Add reset method. --- server/src/objects/Deck.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/src/objects/Deck.ts b/server/src/objects/Deck.ts index 64404ec..a65e249 100644 --- a/server/src/objects/Deck.ts +++ b/server/src/objects/Deck.ts @@ -58,6 +58,13 @@ export class Deck { }; + public reset() { + this._deck.push(...this._discard, ...this._unknown); + this._discard = []; + this._unknown = []; + }; + + public toJSON(): datastoreDeck { /** * Converts this Deck into a JSON-compatible object