From 37c7ffb6f73a8f28bddb4c4814a90b50bd7a979c Mon Sep 17 00:00:00 2001 From: Daan Breur Date: Sat, 27 Nov 2021 15:33:46 +0100 Subject: [PATCH] Edit GameCreationPayload - `fullShapePercentage` and `wierdShapePercentage` added to `GameCreationPayload` - Use the updated `GameCreationPayload` Signed-off-by: Daan Breur --- src/js/states/ingame.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/js/states/ingame.js b/src/js/states/ingame.js index d0ad8e99..220f31ea 100644 --- a/src/js/states/ingame.js +++ b/src/js/states/ingame.js @@ -54,6 +54,12 @@ export class GameCreationPayload { /** @type {boolean} */ this.allowNonPrimaryColors; + + /** @type {number} */ + this.fullShapePercentage; + + /** @type {number} */ + this.wierdShapePercentage; } } @@ -85,6 +91,12 @@ export class InGameState extends GameState { /** @type {boolean} */ this.allowNonPrimaryColors = null; + /** @type {number} */ + this.fullShapePercentage = null; + + /** @type {number} */ + this.wierdShapePercentage = null; + this.boundInputFilter = this.filterInput.bind(this); /** @@ -262,7 +274,12 @@ export class InGameState extends GameState { */ stage4aInitEmptyGame() { if (this.switchStage(stages.s4_A_initEmptyGame)) { - this.core.initNewGame({ seed: this.seed, allowNonPrimaryColors: this.allowNonPrimaryColors }); + this.core.initNewGame({ + seed: this.seed, + allowNonPrimaryColors: this.allowNonPrimaryColors, + fullShapePercentage: this.fullShapePercentage, + wierdShapePercentage: this.wierdShapePercentage, + }); this.stage5FirstUpdate(); } } @@ -383,6 +400,8 @@ export class InGameState extends GameState { this.gameModeId = payload.gameModeId; this.seed = payload.seed; this.allowNonPrimaryColors = payload.allowNonPrimaryColors; + this.fullShapePercentage = payload.fullShapePercentage; + this.wierdShapePercentage = payload.wierdShapePercentage; this.loadingOverlay = new GameLoadingOverlay(this.app, this.getDivElement()); this.loadingOverlay.showBasic();