From c7f8b50d1358127b777840721177bb64f9ade9cb Mon Sep 17 00:00:00 2001 From: Magnus Grimstvedt Saltnes Date: Thu, 18 Jun 2020 22:18:32 +0200 Subject: [PATCH 1/7] Adds tracking for rotation per building type. Adds a setting to go back to one global base rotation. --- src/js/game/hud/parts/building_placer.js | 16 +++---- .../game/hud/parts/building_placer_logic.js | 48 +++++++++++++++---- src/js/profile/application_settings.js | 11 ++++- 3 files changed, 56 insertions(+), 19 deletions(-) diff --git a/src/js/game/hud/parts/building_placer.js b/src/js/game/hud/parts/building_placer.js index 5faec6ab..e3a75400 100644 --- a/src/js/game/hud/parts/building_placer.js +++ b/src/js/game/hud/parts/building_placer.js @@ -82,9 +82,9 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic { this.buildingInfoElements.tutorialImage.setAttribute( "data-icon", "building_tutorials/" + - metaBuilding.getId() + - (variant === defaultBuildingVariant ? "" : "-" + variant) + - ".png" + metaBuilding.getId() + + (variant === defaultBuildingVariant ? "" : "-" + variant) + + ".png" ); removeAllChildren(this.buildingInfoElements.additionalInfo); @@ -122,10 +122,10 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic { T.ingame.buildingPlacement.cycleBuildingVariants.replace( "", "" + - this.root.keyMapper - .getBinding(KEYMAPPINGS.placement.cycleBuildingVariants) - .getKeyCodeString() + - "" + this.root.keyMapper + .getBinding(KEYMAPPINGS.placement.cycleBuildingVariants) + .getKeyCodeString() + + "" ) ); @@ -201,7 +201,7 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic { } = metaBuilding.computeOptimalDirectionAndRotationVariantAtTile( this.root, mouseTile, - this.currentBaseRotation, + this.getBaseRotation(), this.currentVariant.get() ); diff --git a/src/js/game/hud/parts/building_placer_logic.js b/src/js/game/hud/parts/building_placer_logic.js index 6aee65b6..a58d2b64 100644 --- a/src/js/game/hud/parts/building_placer_logic.js +++ b/src/js/game/hud/parts/building_placer_logic.js @@ -1,3 +1,4 @@ + import { Math_abs, Math_degrees, Math_round } from "../../../core/builtins"; import { globalConfig } from "../../../core/config"; import { gMetaBuildingRegistry } from "../../../core/global_registries"; @@ -45,7 +46,34 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { * The current rotation * @type {number} */ - this.currentBaseRotation = 0; + this.currentBaseRotationGeneral = 0; + + /** + * The current rotation preference for each building. + * @type {Object.} + */ + this.preferredRotations = {}; + + this.getBaseRotation = function () { + const rotationByBuilding = this.root.app.settings.getAllSettings().rotationByBuilding; + if (!rotationByBuilding) { + return this.currentBaseRotationGeneral; + } + const id = this.currentMetaBuilding.get().getId(); + return this.preferredRotations[id] || this.currentBaseRotationGeneral; + + } + + this.setBaseRotation = function (rotation) { + const rotationByBuilding = this.root.app.settings.getAllSettings().rotationByBuilding; + if (!rotationByBuilding) { + this.currentBaseRotationGeneral = rotation; + } else { + const id = this.currentMetaBuilding.get().getId(); + this.preferredRotations[id] = rotation; + } + } + /** * Whether we are currently dragging @@ -200,12 +228,12 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { const selectedBuilding = this.currentMetaBuilding.get(); if (selectedBuilding) { if (this.root.keyMapper.getBinding(KEYMAPPINGS.placement.rotateInverseModifier).pressed) { - this.currentBaseRotation = (this.currentBaseRotation + 270) % 360; + this.setBaseRotation((this.getBaseRotation() + 270) % 360); } else { - this.currentBaseRotation = (this.currentBaseRotation + 90) % 360; + this.setBaseRotation((this.getBaseRotation() + 90) % 360); } const staticComp = this.fakeEntity.components.StaticMapEntity; - staticComp.rotation = this.currentBaseRotation; + staticComp.rotation = this.getBaseRotation(); } } /** @@ -377,7 +405,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { const { rotation, rotationVariant } = metaBuilding.computeOptimalDirectionAndRotationVariantAtTile( this.root, tile, - this.currentBaseRotation, + this.getBaseRotation(), this.currentVariant.get() ); @@ -385,7 +413,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { origin: tile, rotation, rotationVariant, - originalRotation: this.currentBaseRotation, + originalRotation: this.getBaseRotation(), building: this.currentMetaBuilding.get(), variant: this.currentVariant.get(), }); @@ -401,7 +429,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { KEYMAPPINGS.placementModifiers.placementDisableAutoOrientation ).pressed ) { - this.currentBaseRotation = (180 + this.currentBaseRotation) % 360; + this.setBaseRotation((180 + this.getBaseRotation()) % 360); } // Check if we should stop placement @@ -451,7 +479,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { for (let i = 0; i < path.length; ++i) { const { rotation, tile } = path[i]; - this.currentBaseRotation = rotation; + this.setBaseRotation(rotation); this.tryPlaceCurrentBuildingAt(tile); } }); @@ -634,11 +662,11 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { ) { const delta = newPos.sub(oldPos); const angleDeg = Math_degrees(delta.angle()); - this.currentBaseRotation = (Math.round(angleDeg / 90) * 90 + 360) % 360; + this.setBaseRotation((Math.round(angleDeg / 90) * 90 + 360) % 360); // Holding alt inverts the placement if (this.root.keyMapper.getBinding(KEYMAPPINGS.placementModifiers.placeInverse).pressed) { - this.currentBaseRotation = (180 + this.currentBaseRotation) % 360; + this.setBaseRotation((180 + this.getBaseRotation()) % 360); } } diff --git a/src/js/profile/application_settings.js b/src/js/profile/application_settings.js index 16ec4cbd..0e03e902 100644 --- a/src/js/profile/application_settings.js +++ b/src/js/profile/application_settings.js @@ -248,9 +248,10 @@ export const allApplicationSettings = [ new BoolSetting("alwaysMultiplace", categoryGame, (app, value) => {}), new BoolSetting("enableTunnelSmartplace", categoryGame, (app, value) => {}), - new BoolSetting("vignette", categoryGame, (app, value) => {}), + new BoolSetting("vignette", categoryGame, (app, value) => {}),<<<<<<< HEAD new BoolSetting("compactBuildingInfo", categoryGame, (app, value) => {}), new BoolSetting("disableCutDeleteWarnings", categoryGame, (app, value) => {}), + new BoolSetting("rotationByBuilding", categoryGame, (app, value) => {}), ]; export function getApplicationSettingById(id) { @@ -277,6 +278,8 @@ class SettingsStorage { this.vignette = true; this.compactBuildingInfo = false; this.disableCutDeleteWarnings = false; + this.rotationByBuilding = true; + this.enableColorBlindHelper = false; @@ -527,6 +530,7 @@ export class ApplicationSettings extends ReadWriteProxy { } if (data.version < 13) { +<<<<<<< HEAD data.settings.compactBuildingInfo = false; data.version = 13; } @@ -550,6 +554,11 @@ export class ApplicationSettings extends ReadWriteProxy { if (data.version < 17) { data.settings.enableColorBlindHelper = false; data.version = 17; +======= + data.settings.rotationByBuilding = true; + data.version = 13; + +>>>>>>> 655c356... Adds tracking for rotation per building type. } return ExplainedResult.good(); From efdaf74659e4c74bae5d778165abb23b28b0a0fa Mon Sep 17 00:00:00 2001 From: Magnus Grimstvedt Saltnes Date: Thu, 18 Jun 2020 22:30:17 +0200 Subject: [PATCH 2/7] Adds English strings for rotationByBuilding. --- translations/base-en.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/translations/base-en.yaml b/translations/base-en.yaml index 2ad5ef07..458086ac 100644 --- a/translations/base-en.yaml +++ b/translations/base-en.yaml @@ -721,6 +721,11 @@ settings: title: Vignette description: >- Enables the vignette which darkens the screen corners and makes text easier to read. + + rotationByBuilding: + title: Rotation by building type + description: >- + Each building type remembers the rotation you last set it to individually. This may be more comfortable if you frequently switch between placing different building types. compactBuildingInfo: title: Compact Building Infos From 9a00931c3fb3d602e4c01e7ade63039b5628591e Mon Sep 17 00:00:00 2001 From: Magnus Grimstvedt Saltnes Date: Thu, 18 Jun 2020 22:48:36 +0200 Subject: [PATCH 3/7] Implements some linter recommendations for CI check. --- src/js/game/hud/parts/building_placer_logic.js | 7 ++----- src/js/profile/application_settings.js | 8 +++----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/js/game/hud/parts/building_placer_logic.js b/src/js/game/hud/parts/building_placer_logic.js index a58d2b64..5a462f47 100644 --- a/src/js/game/hud/parts/building_placer_logic.js +++ b/src/js/game/hud/parts/building_placer_logic.js @@ -1,4 +1,3 @@ - import { Math_abs, Math_degrees, Math_round } from "../../../core/builtins"; import { globalConfig } from "../../../core/config"; import { gMetaBuildingRegistry } from "../../../core/global_registries"; @@ -61,8 +60,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { } const id = this.currentMetaBuilding.get().getId(); return this.preferredRotations[id] || this.currentBaseRotationGeneral; - - } + }; this.setBaseRotation = function (rotation) { const rotationByBuilding = this.root.app.settings.getAllSettings().rotationByBuilding; @@ -72,8 +70,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { const id = this.currentMetaBuilding.get().getId(); this.preferredRotations[id] = rotation; } - } - + }; /** * Whether we are currently dragging diff --git a/src/js/profile/application_settings.js b/src/js/profile/application_settings.js index 0e03e902..92edf124 100644 --- a/src/js/profile/application_settings.js +++ b/src/js/profile/application_settings.js @@ -530,7 +530,6 @@ export class ApplicationSettings extends ReadWriteProxy { } if (data.version < 13) { -<<<<<<< HEAD data.settings.compactBuildingInfo = false; data.version = 13; } @@ -554,11 +553,10 @@ export class ApplicationSettings extends ReadWriteProxy { if (data.version < 17) { data.settings.enableColorBlindHelper = false; data.version = 17; -======= + } + if(data.version < 18) { data.settings.rotationByBuilding = true; - data.version = 13; - ->>>>>>> 655c356... Adds tracking for rotation per building type. + data.version = 18; } return ExplainedResult.good(); From e18a888210ecc72132d7dfee91ddde142b98b1d7 Mon Sep 17 00:00:00 2001 From: Magnus Grimstvedt Saltnes Date: Thu, 18 Jun 2020 22:55:03 +0200 Subject: [PATCH 4/7] Attempts to fix some whitespace differences. --- src/js/game/hud/parts/building_placer.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/js/game/hud/parts/building_placer.js b/src/js/game/hud/parts/building_placer.js index e3a75400..6ccf00ad 100644 --- a/src/js/game/hud/parts/building_placer.js +++ b/src/js/game/hud/parts/building_placer.js @@ -82,9 +82,9 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic { this.buildingInfoElements.tutorialImage.setAttribute( "data-icon", "building_tutorials/" + - metaBuilding.getId() + - (variant === defaultBuildingVariant ? "" : "-" + variant) + - ".png" + metaBuilding.getId() + + (variant === defaultBuildingVariant ? "" : "-" + variant) + + ".png" ); removeAllChildren(this.buildingInfoElements.additionalInfo); @@ -122,10 +122,10 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic { T.ingame.buildingPlacement.cycleBuildingVariants.replace( "", "" + - this.root.keyMapper - .getBinding(KEYMAPPINGS.placement.cycleBuildingVariants) - .getKeyCodeString() + - "" + this.root.keyMapper + .getBinding(KEYMAPPINGS.placement.cycleBuildingVariants) + .getKeyCodeString() + + "" ) ); From 553ebb5ef6ae7ab721dac2af6c3170d981b1f80e Mon Sep 17 00:00:00 2001 From: Magnus Grimstvedt Saltnes Date: Tue, 23 Jun 2020 12:03:32 +0200 Subject: [PATCH 5/7] Switches to using ES6 get/set for currentBaseRotation. --- src/js/game/hud/parts/building_placer.js | 2 +- .../game/hud/parts/building_placer_logic.js | 69 +++++++++++-------- src/js/profile/application_settings.js | 5 +- 3 files changed, 42 insertions(+), 34 deletions(-) diff --git a/src/js/game/hud/parts/building_placer.js b/src/js/game/hud/parts/building_placer.js index 6ccf00ad..5faec6ab 100644 --- a/src/js/game/hud/parts/building_placer.js +++ b/src/js/game/hud/parts/building_placer.js @@ -201,7 +201,7 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic { } = metaBuilding.computeOptimalDirectionAndRotationVariantAtTile( this.root, mouseTile, - this.getBaseRotation(), + this.currentBaseRotation, this.currentVariant.get() ); diff --git a/src/js/game/hud/parts/building_placer_logic.js b/src/js/game/hud/parts/building_placer_logic.js index 5a462f47..43abaf6a 100644 --- a/src/js/game/hud/parts/building_placer_logic.js +++ b/src/js/game/hud/parts/building_placer_logic.js @@ -49,28 +49,9 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { /** * The current rotation preference for each building. - * @type {Object.} + * @type{Object.} */ - this.preferredRotations = {}; - - this.getBaseRotation = function () { - const rotationByBuilding = this.root.app.settings.getAllSettings().rotationByBuilding; - if (!rotationByBuilding) { - return this.currentBaseRotationGeneral; - } - const id = this.currentMetaBuilding.get().getId(); - return this.preferredRotations[id] || this.currentBaseRotationGeneral; - }; - - this.setBaseRotation = function (rotation) { - const rotationByBuilding = this.root.app.settings.getAllSettings().rotationByBuilding; - if (!rotationByBuilding) { - this.currentBaseRotationGeneral = rotation; - } else { - const id = this.currentMetaBuilding.get().getId(); - this.preferredRotations[id] = rotation; - } - }; + this.preferredBaseRotations = {}; /** * Whether we are currently dragging @@ -139,6 +120,34 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { this.root.camera.upPostHandler.add(this.onMouseUp, this); } + /** + * Returns the current base rotation for the current meta-building. + * @returns {number} + */ + get currentBaseRotation() { + const rotationByBuilding = this.root.app.settings.getAllSettings().rotationByBuilding; + if (!rotationByBuilding) { + return this.currentBaseRotationGeneral; + } + const id = this.currentMetaBuilding.get().getId(); + return this.preferredBaseRotations[id] == null + ? this.currentBaseRotationGeneral + : this.preferredBaseRotations[id]; + } + + /** + * Sets the base rotation for the current meta-building. + */ + set currentBaseRotation(rotation) { + const rotationByBuilding = this.root.app.settings.getAllSettings().rotationByBuilding; + if (!rotationByBuilding) { + this.currentBaseRotationGeneral = rotation; + } else { + const id = this.currentMetaBuilding.get().getId(); + this.preferredBaseRotations[id] = rotation; + } + } + /** * Returns if the direction lock is currently active * @returns {boolean} @@ -225,12 +234,12 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { const selectedBuilding = this.currentMetaBuilding.get(); if (selectedBuilding) { if (this.root.keyMapper.getBinding(KEYMAPPINGS.placement.rotateInverseModifier).pressed) { - this.setBaseRotation((this.getBaseRotation() + 270) % 360); + this.currentBaseRotation = (this.currentBaseRotation + 270) % 360; } else { - this.setBaseRotation((this.getBaseRotation() + 90) % 360); + this.currentBaseRotation = (this.currentBaseRotation + 90) % 360; } const staticComp = this.fakeEntity.components.StaticMapEntity; - staticComp.rotation = this.getBaseRotation(); + staticComp.rotation = this.currentBaseRotation; } } /** @@ -402,7 +411,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { const { rotation, rotationVariant } = metaBuilding.computeOptimalDirectionAndRotationVariantAtTile( this.root, tile, - this.getBaseRotation(), + this.currentBaseRotation, this.currentVariant.get() ); @@ -410,7 +419,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { origin: tile, rotation, rotationVariant, - originalRotation: this.getBaseRotation(), + originalRotation: this.currentBaseRotation, building: this.currentMetaBuilding.get(), variant: this.currentVariant.get(), }); @@ -426,7 +435,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { KEYMAPPINGS.placementModifiers.placementDisableAutoOrientation ).pressed ) { - this.setBaseRotation((180 + this.getBaseRotation()) % 360); + this.currentBaseRotation = (180 + this.currentBaseRotation) % 360; } // Check if we should stop placement @@ -476,7 +485,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { for (let i = 0; i < path.length; ++i) { const { rotation, tile } = path[i]; - this.setBaseRotation(rotation); + this.currentBaseRotation = rotation; this.tryPlaceCurrentBuildingAt(tile); } }); @@ -659,11 +668,11 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { ) { const delta = newPos.sub(oldPos); const angleDeg = Math_degrees(delta.angle()); - this.setBaseRotation((Math.round(angleDeg / 90) * 90 + 360) % 360); + this.currentBaseRotation = (Math.round(angleDeg / 90) * 90 + 360) % 360; // Holding alt inverts the placement if (this.root.keyMapper.getBinding(KEYMAPPINGS.placementModifiers.placeInverse).pressed) { - this.setBaseRotation((180 + this.getBaseRotation()) % 360); + this.currentBaseRotation = (180 + this.currentBaseRotation) % 360; } } diff --git a/src/js/profile/application_settings.js b/src/js/profile/application_settings.js index 92edf124..8fd80df0 100644 --- a/src/js/profile/application_settings.js +++ b/src/js/profile/application_settings.js @@ -248,7 +248,7 @@ export const allApplicationSettings = [ new BoolSetting("alwaysMultiplace", categoryGame, (app, value) => {}), new BoolSetting("enableTunnelSmartplace", categoryGame, (app, value) => {}), - new BoolSetting("vignette", categoryGame, (app, value) => {}),<<<<<<< HEAD + new BoolSetting("vignette", categoryGame, (app, value) => {}), new BoolSetting("compactBuildingInfo", categoryGame, (app, value) => {}), new BoolSetting("disableCutDeleteWarnings", categoryGame, (app, value) => {}), new BoolSetting("rotationByBuilding", categoryGame, (app, value) => {}), @@ -280,7 +280,6 @@ class SettingsStorage { this.disableCutDeleteWarnings = false; this.rotationByBuilding = true; - this.enableColorBlindHelper = false; /** @@ -554,7 +553,7 @@ export class ApplicationSettings extends ReadWriteProxy { data.settings.enableColorBlindHelper = false; data.version = 17; } - if(data.version < 18) { + if (data.version < 18) { data.settings.rotationByBuilding = true; data.version = 18; } From 8ec646a8f634d1bb4fb84c0a522e69878ef151d2 Mon Sep 17 00:00:00 2001 From: Magnus Grimstvedt Saltnes Date: Wed, 24 Jun 2020 14:20:16 +0200 Subject: [PATCH 6/7] Guards against undefined values/keys in base rotation logic. One-lines setting check per tobspr's recommendation. --- .../game/hud/parts/building_placer_logic.js | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/js/game/hud/parts/building_placer_logic.js b/src/js/game/hud/parts/building_placer_logic.js index 43abaf6a..106e642c 100644 --- a/src/js/game/hud/parts/building_placer_logic.js +++ b/src/js/game/hud/parts/building_placer_logic.js @@ -125,26 +125,30 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { * @returns {number} */ get currentBaseRotation() { - const rotationByBuilding = this.root.app.settings.getAllSettings().rotationByBuilding; - if (!rotationByBuilding) { + if (!this.root.app.settings.getAllSettings().rotationByBuilding) { + return this.currentBaseRotationGeneral; + } + const building = this.currentMetaBuilding.get(); + if (building != undefined && this.preferredBaseRotations.hasOwnProperty(building.getId())) { + return this.preferredBaseRotations[building.getId()]; + } else { return this.currentBaseRotationGeneral; } - const id = this.currentMetaBuilding.get().getId(); - return this.preferredBaseRotations[id] == null - ? this.currentBaseRotationGeneral - : this.preferredBaseRotations[id]; } /** * Sets the base rotation for the current meta-building. */ set currentBaseRotation(rotation) { - const rotationByBuilding = this.root.app.settings.getAllSettings().rotationByBuilding; - if (!rotationByBuilding) { + if (!this.root.app.settings.getAllSettings().rotationByBuilding) { this.currentBaseRotationGeneral = rotation; } else { - const id = this.currentMetaBuilding.get().getId(); - this.preferredBaseRotations[id] = rotation; + const building = this.currentMetaBuilding.get(); + if (building != undefined) { + this.preferredBaseRotations[building.getId()] = rotation; + } else { + this.currentBaseRotationGeneral = rotation; + } } } From fbc543cf3f44f8d643a58bc1c23a07428771efbd Mon Sep 17 00:00:00 2001 From: Magnus Grimstvedt Saltnes Date: Wed, 24 Jun 2020 16:28:01 +0200 Subject: [PATCH 7/7] Corrects some code style issues. --- src/js/game/hud/parts/building_placer_logic.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/js/game/hud/parts/building_placer_logic.js b/src/js/game/hud/parts/building_placer_logic.js index 106e642c..9bf031c0 100644 --- a/src/js/game/hud/parts/building_placer_logic.js +++ b/src/js/game/hud/parts/building_placer_logic.js @@ -128,9 +128,9 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { if (!this.root.app.settings.getAllSettings().rotationByBuilding) { return this.currentBaseRotationGeneral; } - const building = this.currentMetaBuilding.get(); - if (building != undefined && this.preferredBaseRotations.hasOwnProperty(building.getId())) { - return this.preferredBaseRotations[building.getId()]; + const metaBuilding = this.currentMetaBuilding.get(); + if (metaBuilding && this.preferredBaseRotations.hasOwnProperty(metaBuilding.getId())) { + return this.preferredBaseRotations[metaBuilding.getId()]; } else { return this.currentBaseRotationGeneral; } @@ -138,14 +138,15 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { /** * Sets the base rotation for the current meta-building. + * @param {number} rotation The new rotation/angle. */ set currentBaseRotation(rotation) { if (!this.root.app.settings.getAllSettings().rotationByBuilding) { this.currentBaseRotationGeneral = rotation; } else { - const building = this.currentMetaBuilding.get(); - if (building != undefined) { - this.preferredBaseRotations[building.getId()] = rotation; + const metaBuilding = this.currentMetaBuilding.get(); + if (metaBuilding) { + this.preferredBaseRotations[metaBuilding.getId()] = rotation; } else { this.currentBaseRotationGeneral = rotation; }