From 1ab0fb7d9ce7db5e24007f80f25d0aec5adda9db Mon Sep 17 00:00:00 2001 From: tobspr Date: Sun, 11 Oct 2020 08:18:55 +0200 Subject: [PATCH] Fix stacking bug and bump version, fixes #814 --- src/js/changelog.js | 8 ++++++++ src/js/game/shape_definition_manager.js | 18 +++++++++--------- version | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/js/changelog.js b/src/js/changelog.js index 95aca51d..bc73ad0f 100644 --- a/src/js/changelog.js +++ b/src/js/changelog.js @@ -1,4 +1,12 @@ export const CHANGELOG = [ + { + version: "1.2.1", + date: "unreleased", + entries: [ + "Fixed stacking bug for level 26 which required restarting the game", + "Updated translations", + ], + }, { version: "1.2.0", date: "09.10.2020", diff --git a/src/js/game/shape_definition_manager.js b/src/js/game/shape_definition_manager.js index 86723fcd..5bcfcc4b 100644 --- a/src/js/game/shape_definition_manager.js +++ b/src/js/game/shape_definition_manager.js @@ -31,7 +31,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject { */ this.shapeKeyToItem = {}; - // Caches operations in the form of 'operation:def1[:def2]' + // Caches operations in the form of 'operation/def1[/def2]' /** @type {Object.|ShapeDefinition>} */ this.operationCache = {}; } @@ -89,7 +89,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject { * @returns {[ShapeDefinition, ShapeDefinition]} */ shapeActionCutHalf(definition) { - const key = "cut:" + definition.getHash(); + const key = "cut/" + definition.getHash(); if (this.operationCache[key]) { return /** @type {[ShapeDefinition, ShapeDefinition]} */ (this.operationCache[key]); } @@ -108,7 +108,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject { * @returns {[ShapeDefinition, ShapeDefinition, ShapeDefinition, ShapeDefinition]} */ shapeActionCutQuad(definition) { - const key = "cut-quad:" + definition.getHash(); + const key = "cut-quad/" + definition.getHash(); if (this.operationCache[key]) { return /** @type {[ShapeDefinition, ShapeDefinition, ShapeDefinition, ShapeDefinition]} */ (this .operationCache[key]); @@ -130,7 +130,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject { * @returns {ShapeDefinition} */ shapeActionRotateCW(definition) { - const key = "rotate-cw:" + definition.getHash(); + const key = "rotate-cw/" + definition.getHash(); if (this.operationCache[key]) { return /** @type {ShapeDefinition} */ (this.operationCache[key]); } @@ -148,7 +148,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject { * @returns {ShapeDefinition} */ shapeActionRotateCCW(definition) { - const key = "rotate-ccw:" + definition.getHash(); + const key = "rotate-ccw/" + definition.getHash(); if (this.operationCache[key]) { return /** @type {ShapeDefinition} */ (this.operationCache[key]); } @@ -166,7 +166,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject { * @returns {ShapeDefinition} */ shapeActionRotate180(definition) { - const key = "rotate-fl:" + definition.getHash(); + const key = "rotate-fl/" + definition.getHash(); if (this.operationCache[key]) { return /** @type {ShapeDefinition} */ (this.operationCache[key]); } @@ -185,7 +185,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject { * @returns {ShapeDefinition} */ shapeActionStack(lowerDefinition, upperDefinition) { - const key = "stack:" + lowerDefinition.getHash() + ":" + upperDefinition.getHash(); + const key = "stack/" + lowerDefinition.getHash() + "/" + upperDefinition.getHash(); if (this.operationCache[key]) { return /** @type {ShapeDefinition} */ (this.operationCache[key]); } @@ -202,7 +202,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject { * @returns {ShapeDefinition} */ shapeActionPaintWith(definition, color) { - const key = "paint:" + definition.getHash() + ":" + color; + const key = "paint/" + definition.getHash() + "/" + color; if (this.operationCache[key]) { return /** @type {ShapeDefinition} */ (this.operationCache[key]); } @@ -219,7 +219,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject { * @returns {ShapeDefinition} */ shapeActionPaintWith4Colors(definition, colors) { - const key = "paint4:" + definition.getHash() + ":" + colors.join(","); + const key = "paint4/" + definition.getHash() + "/" + colors.join(","); if (this.operationCache[key]) { return /** @type {ShapeDefinition} */ (this.operationCache[key]); } diff --git a/version b/version index 867e5243..cb174d58 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.2.0 \ No newline at end of file +1.2.1 \ No newline at end of file