From 422f96e61d43fb1b89ab25b74844cccb4af7a7fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Jakse?= Date: Thu, 16 Apr 2020 00:28:15 +0200 Subject: [PATCH] Remove information about the bag being suffled --- trivabble-server.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/trivabble-server.js b/trivabble-server.js index f88b4bf..680df2d 100644 --- a/trivabble-server.js +++ b/trivabble-server.js @@ -272,29 +272,17 @@ Game.prototype.toJSON = function () { bag: this.bag, racks: this.racks, scores: this.scores, - lastUpdated: this.lastUpdated.toISOString(), - bagShuffled: true // Will be gone soon, needed for compatibility with saved games + lastUpdated: this.lastUpdated.toISOString() }; }; Game.fromJSON = function (obj) { - // WARNING: modifies the passed parameter because of the suffling. - // This is harmless here, and temporary anyway. - // Variable bagShuffled is soon to be gone. - const game = new Game(); game.board = obj.board || newBoard(); game.bag = obj.bag || frBag.slice(); game.racks = obj.racks || {}; game.scores = obj.scores || {}; game.lastUpdated = obj.lastUpdated ? new Date(obj.lastUpdated) : new Date(); - - // To delete soon - if (!obj.bagShuffled) { - game.bag = game.bag.filter((tile) => tile !== ""); - shuffleInPlace(game.bag); - } - return game; }; -- 2.30.2