From 8adf63dff9f5ef2262dc42da55a2360969e6c441 Mon Sep 17 00:00:00 2001 From: fgnm Date: Sat, 7 Aug 2021 18:07:09 +0200 Subject: [PATCH] Move Editor to Artemis-based runtime: * Epic artemis switch! * Update to 0.0.8-SNAPSHOT --- assets/configs/app.properties | 2 +- ...atch-0.0.7.jar => plugin-9patch-0.0.8.jar} | Bin 22746 -> 22806 bytes assets/plugins/plugin-performance-0.0.7.jar | Bin 5745 -> 0 bytes assets/plugins/plugin-performance-0.0.8.jar | Bin 0 -> 5898 bytes ...0.7.jar => plugin-skin-composer-0.0.8.jar} | Bin 9943 -> 9943 bytes ...tiled-0.0.7.jar => plugin-tiled-0.0.8.jar} | Bin 102614 -> 102647 bytes build.gradle | 4 +- gradle.properties | 2 +- h2d-libgdx-spine-extension | 2 +- h2d-libgdx-talos-extension | 2 +- hyperlap2d-common-api | 2 +- hyperlap2d-runtime-libgdx | 2 +- plugin-9patch/build.gradle | 4 +- .../plugin/ninepatch/MainPanelMediator.java | 18 +- .../plugin/ninepatch/NinePatchPlugin.java | 9 +- plugin-performance/build.gradle | 4 +- .../plugin/performance/PerformancePanel.java | 13 +- .../performance/PerformancePanelMediator.java | 3 +- plugin-skin-composer/build.gradle | 4 +- plugin-tiled/build.gradle | 4 +- .../editor/plugin/tiled/TiledPanel.java | 5 +- .../plugin/tiled/TiledPanelMediator.java | 8 +- .../editor/plugin/tiled/TiledPlugin.java | 33 ++- .../tiled/manager/AutoGridTileManager.java | 38 ++- .../plugin/tiled/tools/DeleteTileTool.java | 21 +- .../plugin/tiled/tools/DrawTileTool.java | 23 +- .../drawStrategy/AutoTileDrawStrategy.java | 18 +- .../tools/drawStrategy/BasicDrawStrategy.java | 11 +- .../tools/drawStrategy/IDrawStrategy.java | 4 +- .../tools/drawStrategy/ImageDrawStrategy.java | 14 +- .../tools/drawStrategy/SpineDrawStrategy.java | 11 +- .../drawStrategy/SpriteDrawStrategy.java | 11 +- .../commands/AddComponentToItemCommand.java | 19 +- .../commands/AddSelectionCommand.java | 7 +- .../commands/AddToLibraryCommand.java | 16 +- .../commands/ChangeOriginPointPosition.java | 8 +- .../ChangePolygonVertexPositionCommand.java | 3 +- .../CompositeCameraChangeCommand.java | 34 ++- .../commands/ConvertToButtonCommand.java | 14 +- .../commands/ConvertToCompositeCommand.java | 40 ++-- .../commands/CreateItemCommand.java | 20 +- .../commands/CustomVariableModifyCommand.java | 16 +- .../controller/commands/CutItemsCommand.java | 7 +- .../commands/DeleteItemsCommand.java | 19 +- .../commands/DeleteLayerAtomCommand.java | 12 +- .../commands/DeleteLayerCommand.java | 14 +- .../commands/DeletePolygonVertexCommand.java | 3 +- .../EntityModifyRevertibleCommand.java | 23 +- .../ItemChildrenTransformCommand.java | 22 +- .../commands/ItemTransformCommand.java | 18 +- .../controller/commands/ItemsMoveCommand.java | 10 +- .../controller/commands/LayerSwapCommand.java | 10 +- .../controller/commands/NewLayerCommand.java | 10 +- .../commands/PasteItemsCommand.java | 54 ++--- .../commands/ReleaseSelectionCommand.java | 5 +- .../RemoveComponentFromItemCommand.java | 30 ++- .../commands/RenameLayerCommand.java | 12 +- .../commands/SetSelectionCommand.java | 14 +- .../UpdateEntityComponentsCommand.java | 12 +- .../component/ReplaceRegionCommand.java | 18 +- .../component/ReplaceSpineCommand.java | 22 +- .../ReplaceSpriteAnimationCommand.java | 26 +- .../component/UpdateCompositeDataCommand.java | 18 +- .../component/UpdateImageItemDataCommand.java | 20 +- .../component/UpdateLabelDataCommand.java | 10 +- .../component/UpdateLightBodyDataCommand.java | 12 +- .../component/UpdateLightDataCommand.java | 14 +- .../component/UpdateParticleDataCommand.java | 14 +- .../component/UpdatePhysicsDataCommand.java | 12 +- .../component/UpdatePolygonDataCommand.java | 16 +- .../component/UpdateSensorDataCommand.java | 13 +- .../component/UpdateShaderDataCommand.java | 12 +- .../component/UpdateSpineDataCommand.java | 18 +- .../UpdateSpriteAnimationDataCommand.java | 16 +- .../component/UpdateTalosDataCommand.java | 18 +- .../rednblack/editor/factory/ItemFactory.java | 63 +++-- .../editor/graph/actions/ActionFieldType.java | 2 +- .../editor/live/LivePreviewScreen.java | 13 +- .../rednblack/editor/proxy/PluginManager.java | 16 +- .../editor/proxy/ProjectManager.java | 5 +- .../system/ParticleContinuousSystem.java | 7 +- .../editor/system/PhysicsAdjustSystem.java | 13 +- .../editor/system/TalosContinuousSystem.java | 8 +- .../rednblack/editor/utils/AssetImporter.java | 5 +- .../rednblack/editor/utils/EntityBounds.java | 21 +- .../editor/utils/MoveCommandBuilder.java | 12 +- .../rednblack/editor/utils/asset/Asset.java | 3 +- .../rednblack/editor/utils/asset/IAsset.java | 3 +- .../editor/utils/asset/impl/AtlasAsset.java | 3 +- .../asset/impl/HyperLap2DActionAsset.java | 3 +- .../impl/HyperLap2DInternalLibraryAsset.java | 3 +- .../asset/impl/HyperLap2DLibraryAsset.java | 10 +- .../editor/utils/asset/impl/ImageAsset.java | 15 +- .../utils/asset/impl/ParticleEffectAsset.java | 10 +- .../editor/utils/asset/impl/ShaderAsset.java | 3 +- .../editor/utils/asset/impl/SpineAsset.java | 12 +- .../asset/impl/SpriteAnimationAtlasAsset.java | 13 +- .../utils/asset/impl/TalosVFXAsset.java | 10 +- .../editor/utils/runtime/ComponentCloner.java | 2 +- .../editor/utils/runtime/EntityUtils.java | 222 +++++++++--------- .../runtime/SandboxComponentRetriever.java | 12 + .../editor/view/HyperLap2DScreen.java | 8 +- .../editor/view/HyperLap2DScreenMediator.java | 3 +- .../editor/view/ItemControlMediator.java | 12 +- .../editor/view/SceneControlMediator.java | 13 +- .../editor/view/stage/ItemSelector.java | 118 +++++----- .../rednblack/editor/view/stage/Sandbox.java | 56 ++--- .../editor/view/stage/SandboxMediator.java | 50 ++-- .../editor/view/stage/UIStageMediator.java | 3 +- .../view/stage/input/EntityClickListener.java | 28 +-- .../view/stage/input/InputListener.java | 18 +- .../stage/input/InputListenerComponent.java | 4 +- .../view/stage/input/SandboxInputAdapter.java | 67 +++--- .../view/stage/tools/ConeLightTool.java | 3 +- .../editor/view/stage/tools/ItemDropTool.java | 13 +- .../editor/view/stage/tools/PanTool.java | 9 +- .../view/stage/tools/PointLightTool.java | 3 +- .../editor/view/stage/tools/PolygonTool.java | 22 +- .../view/stage/tools/SelectionTool.java | 70 +++--- .../editor/view/stage/tools/SimpleTool.java | 17 +- .../editor/view/stage/tools/TextTool.java | 5 +- .../view/stage/tools/TransformTool.java | 24 +- .../AbstractTransformStrategy.java | 1 - .../transformStrategy/BasicStrategy.java | 8 +- .../ColorPrimitiveStrategy.java | 8 +- .../transformStrategy/CompositeStrategy.java | 43 ++-- .../transformStrategy/ITransformStrategy.java | 3 +- .../transformStrategy/LabelStrategy.java | 8 +- .../transformStrategy/NinePatchStrategy.java | 10 +- .../editor/view/ui/FollowersUIMediator.java | 28 +-- .../ui/box/UICompositeHierarchyMediator.java | 12 +- .../editor/view/ui/box/UIItemsTreeBox.java | 29 ++- .../view/ui/box/UIItemsTreeBoxMediator.java | 13 +- .../view/ui/box/UILayerBoxMediator.java | 39 ++- .../ui/box/UIMultiPropertyBoxMediator.java | 31 ++- .../ui/dialog/AutoTraceDialogMediator.java | 9 +- .../view/ui/followers/BasicFollower.java | 18 +- .../view/ui/followers/FollowerFactory.java | 3 +- .../view/ui/followers/ImageFollower.java | 3 +- .../view/ui/followers/LightFollower.java | 3 +- .../ui/followers/NormalSelectionFollower.java | 3 +- .../view/ui/followers/ParticleFollower.java | 3 +- .../view/ui/followers/PolygonFollower.java | 10 +- .../view/ui/followers/PolygonFollower2.java | 12 +- .../view/ui/followers/SpineFollower.java | 6 +- .../editor/view/ui/followers/SubFollower.java | 7 +- .../panel/CustomVariablesPanelMediator.java | 14 +- .../EditSpriteAnimationPanelMediator.java | 22 +- .../view/ui/panel/ShaderUniformsPanel.java | 26 +- .../ui/panel/ShaderUniformsPanelMediator.java | 22 +- .../view/ui/panel/TagsPanelMediator.java | 24 +- .../UIAbstractEntityPropertiesMediator.java | 104 ++++++++ .../UIAbstractPropertiesMediator.java | 25 +- .../properties/UIItemPropertiesMediator.java | 14 +- .../panels/UIBasicItemPropertiesMediator.java | 43 ++-- .../UICompositeItemPropertiesMediator.java | 21 +- .../panels/UIImageItemPropertiesMediator.java | 8 +- .../panels/UILabelItemPropertiesMediator.java | 10 +- .../panels/UILightBodyPropertiesMediator.java | 16 +- .../panels/UILightItemPropertiesMediator.java | 12 +- .../UIMultipleSelectPropertiesMediator.java | 5 +- .../panels/UIParticlePropertiesMediator.java | 9 +- .../panels/UIPhysicsPropertiesMediator.java | 11 +- .../UIPolygonComponentPropertiesMediator.java | 12 +- .../panels/UIScenePropertiesMediator.java | 2 +- .../panels/UISensorPropertiesMediator.java | 12 +- .../panels/UIShaderPropertiesMediator.java | 10 +- ...ISpineAnimationItemPropertiesMediator.java | 10 +- ...SpriteAnimationItemPropertiesMediator.java | 8 +- .../panels/UITalosPropertiesMediator.java | 9 +- .../UITypingLabelPropertiesMediator.java | 8 +- 171 files changed, 1400 insertions(+), 1385 deletions(-) rename assets/plugins/{plugin-9patch-0.0.7.jar => plugin-9patch-0.0.8.jar} (64%) delete mode 100644 assets/plugins/plugin-performance-0.0.7.jar create mode 100644 assets/plugins/plugin-performance-0.0.8.jar rename assets/plugins/{plugin-skin-composer-0.0.7.jar => plugin-skin-composer-0.0.8.jar} (87%) rename assets/plugins/{plugin-tiled-0.0.7.jar => plugin-tiled-0.0.8.jar} (54%) create mode 100644 src/main/java/games/rednblack/editor/utils/runtime/SandboxComponentRetriever.java create mode 100644 src/main/java/games/rednblack/editor/view/ui/properties/UIAbstractEntityPropertiesMediator.java diff --git a/assets/configs/app.properties b/assets/configs/app.properties index 707c93aa..779e0e69 100644 --- a/assets/configs/app.properties +++ b/assets/configs/app.properties @@ -1 +1 @@ -version=0.0.7 \ No newline at end of file +version=0.0.8-SNAPSHOT \ No newline at end of file diff --git a/assets/plugins/plugin-9patch-0.0.7.jar b/assets/plugins/plugin-9patch-0.0.8.jar similarity index 64% rename from assets/plugins/plugin-9patch-0.0.7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ovyTMZG382LXgJ**bU|Bp=% z+XG7dW6;0=x;%e@neM;Fe3q{4UuIqRhF|;J|$8P1}s-k z5Z0zo_?Mgf&A~~2bL=o}8cZ0S0U_NVr-!uR`Umj00px&!fFO$SpHUw?`262w0$8j8 z&R>x%14<-!x_@~r*pUGd?H`dYs54{T@1F&B*a!&X|It9G59Wci(3I)f;YB-nn} z3c)7W&;kGVIR0oL&j@w;;vpaasSyxF{!60>b_P=Zt07@XiR3Buzw5^s68*D@|FWz8 YtM*Xl-(<|+4i;V_7$40B_$T3i0DVq5w*UYD diff --git a/assets/plugins/plugin-performance-0.0.7.jar b/assets/plugins/plugin-performance-0.0.7.jar deleted file mode 100644 index 7cecb527586774a57d3abe171deb623146c56700..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5745 zcmbuDcT`i`w#E^NQi4>Gj({LF^xi?i(4|J@4r8p5q<&y*b9(WBoC|Z|=R;-gB(|Q&+~q#>2qC!NEAOJk!KD56p|p zdElN8)jQg^% z>wlAP_So{Nox^WsbpI@~w{fztg#K2|{vXx$W)9|d4z>`esoB3d?TD#P?4Iw1`}vB< z{#Q=wKU~%Sb(bJh8;GN0hPL%RQdu%dtQdGX4mrU63qF0u5(rbOIE5@b70ed)Bxn_vAujFdd2-c+Y8&>H=PUIX zaZ*k|#-Qy(FAF^7!$P6NXT6c_Hh8sDRxk39Jb6dkR;7tDp%4KQo?YxvxOX23&j|MG z1v!cE+f?Is`BZ40PS8|zB9}!9N1XOLn>PdCIv=K0jh_S-TIQsmMNb))AH(fn=($`- z;l4qxf@dkYVgh7s(qUR@Ncr|`lPY5X8j?~Ad_TP9MHb|{bQu*dz_(yQVMRCfv3Mgw zXqEk-ciE5%iz3~?c0;TJ8`V{kM{UmE+c=z?s4<-W)}deOASOw%)E#dg#t*ib$dS{S4v-Nla6Glf0Y)zO_ng0Hpgok1=qXHg;7HI5>Z%C1N&4iC&UVAL%r zMw&r3S%-DUr$@{I;+52`wF1C6pz|4vQLx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?!IgE%Cjmh>SjsUKzA?+b)d5RY<;bt7 z5-ggWBzcjZBDJd)B3Ep8nfG$(A7q?U7u=5H{Cw|%{{921iRBw-$igN@d-lIL;&-C=BZ$z>CEc&4Klt9SG~fB& zkNB>6aW(y+`GfZTO8uSo{fO`C{;TQF>fhMkuS~wPzaR141QY#lO@1SRzw-J{0{`%m z{I6br=7K-_{>%mcBpu literal 0 HcmV?d00001 diff --git a/assets/plugins/plugin-skin-composer-0.0.7.jar b/assets/plugins/plugin-skin-composer-0.0.8.jar similarity index 87% rename from assets/plugins/plugin-skin-composer-0.0.7.jar rename to assets/plugins/plugin-skin-composer-0.0.8.jar index a6ace174bf8de573778b81c5b530190f7fe63643..214b1eaf7e87a3b5dca4a9e23240752d0edbbcb9 100644 GIT binary patch delta 230 zcmccad)=2Wz?+$ci-CcIgQ2~RJ$NFYDhrr4_k_?bN)URL4urmC45lXwGFm|x{*3Nm z#^za!J^T=smLM}Lgk>n!!31ILm2iTJG0Pof0gFvOp#(MTzmgq9#8KG*!YEaS8oycD m5hC(K*#p9GQ3-`G=BngF7y_y}5JrP)CWP@;6)KgWRt^ARJ4jXl delta 230 zcmccad)=2Wz?+$ci-CcIgW+%H|DcI{sw_r{lY=Ijd$NG}ElLo2l@5fyWelb#3o=?k z82*gzV8-TIj6M7imX;thD}-ez*1-f}?UitXiZRO_WC4p!KA~g`wrui$B|C_Sqp|^n tQK}3zezUS8MC6CE2ZZ6G5(;6=Rmq1i1XOb%j0V+A2;;3PR4PHO8~~zFWmo_J diff --git a/assets/plugins/plugin-tiled-0.0.7.jar b/assets/plugins/plugin-tiled-0.0.8.jar similarity index 54% rename from assets/plugins/plugin-tiled-0.0.7.jar rename to assets/plugins/plugin-tiled-0.0.8.jar index cd334bd556be5ec17f626220d78d64f8d46fdad5..88119d0a8717141a7cae8b1e247731f0ddbb958a 100644 GIT binary patch delta 41868 zcmY&<19T=$({{YEb;r)ewr$(C?cBk}wr$(q*xJ~(Hp#}xzwh&W-+#V$&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+++ b/build.gradle @@ -14,7 +14,7 @@ plugins { } group 'games.rednblack' -version '0.0.7' +version '0.0.8' repositories { mavenCentral() @@ -84,7 +84,7 @@ dependencies { exclude group: 'com.badlogicgames.gdx', module: 'gdx-backend-lwjgl' } implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" - implementation "com.badlogicgames.ashley:ashley:$ashleyVersion" + implementation "net.onedaybeard.artemis:artemis-odb:$artemisVersion" implementation "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" diff --git a/gradle.properties b/gradle.properties index 9a91f0a6..ab931061 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ gdxVersion = 1.10.0 lwjgl3Version = 3.2.3 -ashleyVersion = 1.7.4 +artemisVersion = 2.3.0 spineVersion = 3.8.55.1 visuiVersion = 1.5.0 typingLabelVersion = 1.2.0 diff --git a/h2d-libgdx-spine-extension b/h2d-libgdx-spine-extension index 4442f02e..f0b66533 160000 --- a/h2d-libgdx-spine-extension +++ b/h2d-libgdx-spine-extension @@ -1 +1 @@ -Subproject commit 4442f02e7811fb1a1c7b7530448b4704d961daa4 +Subproject commit f0b66533a8e43b0018d4588a6cce9f59e1900a3f diff --git a/h2d-libgdx-talos-extension b/h2d-libgdx-talos-extension index 99011034..82421191 160000 --- a/h2d-libgdx-talos-extension +++ b/h2d-libgdx-talos-extension @@ -1 +1 @@ -Subproject commit 99011034e709c850c4a404fb0f175f09052c64be +Subproject commit 82421191ed3b52c510a4e4437a9ed22d9c571385 diff --git a/hyperlap2d-common-api b/hyperlap2d-common-api index 0f434390..4d2862b4 160000 --- a/hyperlap2d-common-api +++ b/hyperlap2d-common-api @@ -1 +1 @@ -Subproject commit 0f4343906ab88b2afbdb98385f09828568cf5f23 +Subproject commit 4d2862b4c59ca7509cc84f4915bb925cdd124608 diff --git a/hyperlap2d-runtime-libgdx b/hyperlap2d-runtime-libgdx index ffcd8e49..d8879a0f 160000 --- a/hyperlap2d-runtime-libgdx +++ b/hyperlap2d-runtime-libgdx @@ -1 +1 @@ -Subproject commit ffcd8e49c2cbbb567f2483e258828015f8bc16ca +Subproject commit d8879a0f6ee46a420b2d4f6ddf2321646b9cb96f diff --git a/plugin-9patch/build.gradle b/plugin-9patch/build.gradle index 8e55e48f..579dce9e 100644 --- a/plugin-9patch/build.gradle +++ b/plugin-9patch/build.gradle @@ -3,7 +3,7 @@ plugins { } group 'games.rednblack' -version '0.0.7' +version '0.0.8' repositories { mavenCentral() @@ -12,8 +12,8 @@ repositories { dependencies { implementation "com.badlogicgames.gdx:gdx:$gdxVersion" - implementation "com.badlogicgames.ashley:ashley:$ashleyVersion" implementation "com.kotcrab.vis:vis-ui:$visuiVersion" + implementation "net.onedaybeard.artemis:artemis-odb:$artemisVersion" implementation 'net.mountainblade:modular:1.0' diff --git a/plugin-9patch/src/main/java/games/rednblack/editor/plugin/ninepatch/MainPanelMediator.java b/plugin-9patch/src/main/java/games/rednblack/editor/plugin/ninepatch/MainPanelMediator.java index 696912d8..97dcb759 100644 --- a/plugin-9patch/src/main/java/games/rednblack/editor/plugin/ninepatch/MainPanelMediator.java +++ b/plugin-9patch/src/main/java/games/rednblack/editor/plugin/ninepatch/MainPanelMediator.java @@ -1,6 +1,5 @@ package games.rednblack.editor.plugin.ninepatch; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.g2d.NinePatch; @@ -56,8 +55,8 @@ public class MainPanelMediator extends Mediator { convertImageToNinePatch(); break; case MainPanel.SAVE_CLICKED: - Entity entity = plugin.currEditingEntity; - NinePatchComponent ninePatchComponent = ComponentRetriever.get(entity, NinePatchComponent.class); + int entity = plugin.currEditingEntity; + NinePatchComponent ninePatchComponent = ComponentRetriever.get(entity, NinePatchComponent.class, plugin.getAPI().getEngine()); applyNewSplits(ninePatchComponent.textureRegionName, viewComponent.getSplits()); viewComponent.hide(); break; @@ -65,12 +64,12 @@ public class MainPanelMediator extends Mediator { } private void convertImageToNinePatch() { - Entity entity = plugin.currEditingEntity; - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + int entity = plugin.currEditingEntity; + MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class, plugin.getAPI().getEngine()); mainItemComponent.entityType = EntityFactory.NINE_PATCH; - TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class); + TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class, plugin.getAPI().getEngine()); String regionName = textureRegionComponent.regionName; - NinePatchComponent ninePatchComponent = plugin.getAPI().getEngine().createComponent(NinePatchComponent.class); + NinePatchComponent ninePatchComponent = plugin.getAPI().getEngine().edit(entity).create(NinePatchComponent.class); ninePatchComponent.textureRegionName = regionName; TextureAtlas.AtlasRegion newRegion = (TextureAtlas.AtlasRegion) textureRegionComponent.region; int[] splits = {0, 0, 0, 0}; @@ -78,7 +77,6 @@ public class MainPanelMediator extends Mediator { newRegion.names = new String[] {"split", "pad"}; newRegion.values = new int[][] {splits, pad}; ninePatchComponent.ninePatch = new NinePatch(textureRegionComponent.region, 0, 0, 0, 0); - entity.add(ninePatchComponent); //remove original image File originalImg = new File(plugin.getAPI().getProjectPath() + "/assets/orig/images/"+regionName+".png"); @@ -93,8 +91,8 @@ public class MainPanelMediator extends Mediator { } private void loadNinePatch() { - Entity entity = plugin.currEditingEntity; - NinePatchComponent ninePatchComponent = ComponentRetriever.get(entity, NinePatchComponent.class); + int entity = plugin.currEditingEntity; + NinePatchComponent ninePatchComponent = ComponentRetriever.get(entity, NinePatchComponent.class, plugin.getAPI().getEngine()); loadRegion(ninePatchComponent.textureRegionName); viewComponent.show(plugin.getAPI().getUIStage()); } diff --git a/plugin-9patch/src/main/java/games/rednblack/editor/plugin/ninepatch/NinePatchPlugin.java b/plugin-9patch/src/main/java/games/rednblack/editor/plugin/ninepatch/NinePatchPlugin.java index 3e179b69..76ee57b2 100644 --- a/plugin-9patch/src/main/java/games/rednblack/editor/plugin/ninepatch/NinePatchPlugin.java +++ b/plugin-9patch/src/main/java/games/rednblack/editor/plugin/ninepatch/NinePatchPlugin.java @@ -1,6 +1,5 @@ package games.rednblack.editor.plugin.ninepatch; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.utils.Array; import games.rednblack.editor.renderer.components.MainItemComponent; import games.rednblack.editor.renderer.factory.EntityFactory; @@ -23,7 +22,7 @@ public class NinePatchPlugin extends H2DPluginAdapter { private MainPanelMediator performancePanelMediator; - public Entity currEditingEntity; + public int currEditingEntity; public NinePatchPlugin() { super(CLASS_NAME); @@ -38,10 +37,10 @@ public class NinePatchPlugin extends H2DPluginAdapter { } @Override - public void onDropDownOpen(Set selectedEntities, Array actionsSet) { + public void onDropDownOpen(Set selectedEntities, Array actionsSet) { if(selectedEntities.size() == 1) { - Entity entity = selectedEntities.stream().findFirst().get(); - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + int entity = selectedEntities.stream().findFirst().get(); + MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class, getAPI().getEngine()); if(mainItemComponent.entityType == EntityFactory.NINE_PATCH) { // it's our guy diff --git a/plugin-performance/build.gradle b/plugin-performance/build.gradle index 8e55e48f..579dce9e 100644 --- a/plugin-performance/build.gradle +++ b/plugin-performance/build.gradle @@ -3,7 +3,7 @@ plugins { } group 'games.rednblack' -version '0.0.7' +version '0.0.8' repositories { mavenCentral() @@ -12,8 +12,8 @@ repositories { dependencies { implementation "com.badlogicgames.gdx:gdx:$gdxVersion" - implementation "com.badlogicgames.ashley:ashley:$ashleyVersion" implementation "com.kotcrab.vis:vis-ui:$visuiVersion" + implementation "net.onedaybeard.artemis:artemis-odb:$artemisVersion" implementation 'net.mountainblade:modular:1.0' diff --git a/plugin-performance/src/main/java/games/rednblack/editor/plugin/performance/PerformancePanel.java b/plugin-performance/src/main/java/games/rednblack/editor/plugin/performance/PerformancePanel.java index d9b63496..4fe9a831 100644 --- a/plugin-performance/src/main/java/games/rednblack/editor/plugin/performance/PerformancePanel.java +++ b/plugin-performance/src/main/java/games/rednblack/editor/plugin/performance/PerformancePanel.java @@ -1,6 +1,8 @@ package games.rednblack.editor.plugin.performance; -import com.badlogic.ashley.core.Engine; +import com.artemis.Aspect; +import com.artemis.EntitySubscription; +import com.artemis.utils.IntBag; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.profiling.GLProfiler; import com.kotcrab.vis.ui.widget.VisLabel; @@ -16,7 +18,7 @@ public class PerformancePanel extends UIDraggablePanel { private VisLabel entitiesCount, memoryLabel, fpsLbl, glCalls, drawCalls, shaderSwitch, textureBind, vertexCount; - private Engine engine; + private EntitySubscription entitySubscription; private final GLProfiler profiler; public PerformancePanel() { @@ -87,7 +89,7 @@ public class PerformancePanel extends UIDraggablePanel { @Override public void act(float delta) { super.act(delta); - entitiesCount.setText(engine.getEntities().size()); + entitiesCount.setText(entitySubscription.getEntities().size()); fpsLbl.setText(Gdx.graphics.getFramesPerSecond()); MemoryUsage memoryUsage = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage(); long usedMemory = memoryUsage.getUsed() / (1024 * 1024); @@ -109,7 +111,8 @@ public class PerformancePanel extends UIDraggablePanel { profiler.reset(); } - public void setEngine(Engine engine) { - this.engine = engine; + public void setEngine(com.artemis.World engine) { + entitySubscription = engine.getAspectSubscriptionManager() + .get(Aspect.all()); } } \ No newline at end of file diff --git a/plugin-performance/src/main/java/games/rednblack/editor/plugin/performance/PerformancePanelMediator.java b/plugin-performance/src/main/java/games/rednblack/editor/plugin/performance/PerformancePanelMediator.java index 520d9f91..30cdea3a 100644 --- a/plugin-performance/src/main/java/games/rednblack/editor/plugin/performance/PerformancePanelMediator.java +++ b/plugin-performance/src/main/java/games/rednblack/editor/plugin/performance/PerformancePanelMediator.java @@ -1,6 +1,5 @@ package games.rednblack.editor.plugin.performance; -import com.badlogic.ashley.core.Engine; import games.rednblack.h2d.common.MsgAPI; import org.puremvc.java.interfaces.INotification; import org.puremvc.java.patterns.mediator.Mediator; @@ -33,7 +32,7 @@ public class PerformancePanelMediator extends Mediator { switch (notification.getName()) { case MsgAPI.SCENE_LOADED: viewComponent.initView(); - Engine engine = performancePlugin.getAPI().getEngine(); + com.artemis.World engine = performancePlugin.getAPI().getEngine(); viewComponent.setEngine(engine); break; case PerformancePlugin.PANEL_OPEN: diff --git a/plugin-skin-composer/build.gradle b/plugin-skin-composer/build.gradle index 02602a36..784a0c26 100644 --- a/plugin-skin-composer/build.gradle +++ b/plugin-skin-composer/build.gradle @@ -3,7 +3,7 @@ plugins { } group 'games.rednblack' -version '0.0.7' +version '0.0.8' repositories { mavenCentral() @@ -12,8 +12,8 @@ repositories { dependencies { implementation "com.badlogicgames.gdx:gdx:$gdxVersion" - implementation "com.badlogicgames.ashley:ashley:$ashleyVersion" implementation "com.kotcrab.vis:vis-ui:$visuiVersion" + implementation "net.onedaybeard.artemis:artemis-odb:$artemisVersion" implementation 'net.mountainblade:modular:1.0' diff --git a/plugin-tiled/build.gradle b/plugin-tiled/build.gradle index 992bb055..bf2b3e9c 100644 --- a/plugin-tiled/build.gradle +++ b/plugin-tiled/build.gradle @@ -3,7 +3,7 @@ plugins { } group 'games.rednblack' -version '0.0.7' +version '0.0.8' ext { pack = ["assets/textures", "assets/pack/", "tiled"] @@ -16,8 +16,8 @@ repositories { dependencies { implementation "com.badlogicgames.gdx:gdx:$gdxVersion" - implementation "com.badlogicgames.ashley:ashley:$ashleyVersion" implementation "com.kotcrab.vis:vis-ui:$visuiVersion" + implementation "net.onedaybeard.artemis:artemis-odb:$artemisVersion" implementation "com.esotericsoftware.spine:spine-libgdx:$spineVersion" diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPanel.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPanel.java index fc0552f5..55149c9b 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPanel.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPanel.java @@ -20,7 +20,6 @@ package games.rednblack.editor.plugin.tiled; import org.puremvc.java.interfaces.IFacade; -import com.badlogic.ashley.core.Engine; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.kotcrab.vis.ui.widget.VisLabel; import com.kotcrab.vis.ui.widget.VisTable; @@ -60,7 +59,7 @@ public class TiledPanel extends UIDraggablePanel { private SettingsTab settingsTab; private AutoGridTilesTab autoGridTilesTab; private VisTable mainTable; - private Engine engine; + private com.artemis.World engine; private ResourcesManager resourcesManager; private boolean isAutoGridTabSelected; @@ -246,7 +245,7 @@ public class TiledPanel extends UIDraggablePanel { mainTable.add(new VisLabel("no scenes open")).right(); } - public void setEngine(Engine engine) { + public void setEngine(com.artemis.World engine) { this.engine = engine; } diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPanelMediator.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPanelMediator.java index a1908d85..12ea4a57 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPanelMediator.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPanelMediator.java @@ -26,8 +26,6 @@ import games.rednblack.editor.renderer.data.TexturePackVO; import org.puremvc.java.interfaces.INotification; import org.puremvc.java.patterns.mediator.Mediator; -import com.badlogic.ashley.core.Engine; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.badlogic.gdx.files.FileHandle; @@ -118,7 +116,7 @@ public class TiledPanelMediator extends Mediator { targetGrid = initTarget(targetGrid, viewComponent.getDropTable(), false); targetAutoGrid = initTarget(targetAutoGrid, viewComponent.getAutoGridDropTable(), true); - Engine engine = tiledPlugin.getAPI().getEngine(); + com.artemis.World engine = tiledPlugin.getAPI().getEngine(); viewComponent.setEngine(engine); viewComponent.setFixedPosition(); break; @@ -289,8 +287,8 @@ public class TiledPanelMediator extends Mediator { tiledPlugin.saveDataManager.save(); break; case TiledPlugin.ACTION_SET_GRID_SIZE_FROM_ITEM: - Entity observable = notification.getBody(); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(observable, DimensionsComponent.class); + int observable = notification.getBody(); + DimensionsComponent dimensionsComponent = ComponentRetriever.get(observable, DimensionsComponent.class, tiledPlugin.getAPI().getEngine()); tiledPlugin.dataToSave.setGrid(dimensionsComponent.width, dimensionsComponent.height); tiledPlugin.facade.sendNotification(TiledPlugin.GRID_CHANGED); break; diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPlugin.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPlugin.java index 3ddbf599..4902392b 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPlugin.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/TiledPlugin.java @@ -21,7 +21,6 @@ package games.rednblack.editor.plugin.tiled; import java.io.File; import java.util.Set; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.ui.Skin; @@ -156,7 +155,7 @@ public class TiledPlugin extends H2DPluginAdapter { } @Override - public void onDropDownOpen(Set selectedEntities, Array actionsSet) { + public void onDropDownOpen(Set selectedEntities, Array actionsSet) { if(selectedEntities.size() == 1) { actionsSet.add(ACTION_SET_GRID_SIZE_FROM_ITEM); } @@ -172,29 +171,29 @@ public class TiledPlugin extends H2DPluginAdapter { deleteTileTool = new DeleteTileTool(this); } - public Entity getPluginEntityWithParams(int row, int column) { - for (Entity entity : pluginAPI.getProjectEntities()) { + public int getPluginEntityWithParams(int row, int column) { + for (int entity : pluginAPI.getProjectEntities()) { if(!isTile(entity)) continue; boolean isEntityVisible = pluginAPI.isEntityVisible(entity); if (!isEntityVisible || !isOnCurrentSelectedLayer(entity)) continue; - currentEntityMainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + currentEntityMainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class, getAPI().getEngine()); currentEntityCustomVariables = currentEntityMainItemComponent.customVariables; if (currentEntityCustomVariables.getIntegerVariable(ROW) == row && currentEntityCustomVariables.getIntegerVariable(COLUMN) == column) { return entity; } } - return null; + return -1; } - public Entity getPluginEntityWithCoords(float x, float y) { - for (Entity entity : pluginAPI.getProjectEntities()) { + public int getPluginEntityWithCoords(float x, float y) { + for (int entity : pluginAPI.getProjectEntities()) { if (!isTile(entity)) continue; boolean isEntityVisible = pluginAPI.isEntityVisible(entity); if (!isEntityVisible || !isOnCurrentSelectedLayer(entity)) continue; - currentEntityTransformComponent = ComponentRetriever.get(entity, TransformComponent.class); + currentEntityTransformComponent = ComponentRetriever.get(entity, TransformComponent.class, getAPI().getEngine()); Rectangle tmp = new Rectangle( currentEntityTransformComponent.x, currentEntityTransformComponent.y, @@ -205,21 +204,21 @@ public class TiledPlugin extends H2DPluginAdapter { return entity; } } - return null; + return -1; } public float getPixelToWorld() { return pluginAPI.getSceneLoader().getRm().getProjectVO().pixelToWorld; } - public boolean isTile(Entity entity) { - if (entity == null) + public boolean isTile(int entity) { + if (entity == -1) return false; - return ComponentRetriever.get(entity, MainItemComponent.class).tags.contains(TILE_TAG); + return ComponentRetriever.get(entity, MainItemComponent.class, getAPI().getEngine()).tags.contains(TILE_TAG); } - public boolean isOnCurrentSelectedLayer(Entity entity) { - ZIndexComponent entityZComponent = ComponentRetriever.get(entity, ZIndexComponent.class); + public boolean isOnCurrentSelectedLayer(int entity) { + ZIndexComponent entityZComponent = ComponentRetriever.get(entity, ZIndexComponent.class, getAPI().getEngine()); return entityZComponent.layerName.equals(pluginAPI.getCurrentSelectedLayerName()); } @@ -274,8 +273,8 @@ public class TiledPlugin extends H2DPluginAdapter { public void applySelectedTileGridOffset() { pluginAPI.getProjectEntities().forEach(entity -> { if (!(isTile(entity))) return; - TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class, getAPI().getEngine()); + TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class, getAPI().getEngine()); if (selectedTileVO.regionName.equals(textureRegionComponent.regionName)) { transformComponent.x -= selectedTileVO.gridOffset.x; transformComponent.y -= selectedTileVO.gridOffset.y; diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/manager/AutoGridTileManager.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/manager/AutoGridTileManager.java index fa10de33..ef0ab4be 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/manager/AutoGridTileManager.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/manager/AutoGridTileManager.java @@ -1,7 +1,5 @@ package games.rednblack.editor.plugin.tiled.manager; -import com.badlogic.ashley.core.Entity; - import games.rednblack.editor.plugin.tiled.TiledPlugin; import games.rednblack.editor.renderer.components.MainItemComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; @@ -27,8 +25,8 @@ public class AutoGridTileManager { } public void autoFill() { - for (Entity entity : tiledPlugin.getAPI().getProjectEntities()) { - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + for (int entity : tiledPlugin.getAPI().getProjectEntities()) { + MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class, tiledPlugin.getAPI().getEngine()); if (!mainItemComponent.tags.contains(TiledPlugin.AUTO_TILE_TAG)) { continue; } @@ -37,43 +35,43 @@ public class AutoGridTileManager { int c = 0; int val = 0; - Entity ul = tiledPlugin.getPluginEntityWithParams(row + 1, col - 1); - if (ul != null) { + int ul = tiledPlugin.getPluginEntityWithParams(row + 1, col - 1); + if (ul != -1) { c++; val += UL; } - Entity u = tiledPlugin.getPluginEntityWithParams(row + 1, col); - if (u != null) { + int u = tiledPlugin.getPluginEntityWithParams(row + 1, col); + if (u != -1) { c++; val += U; } - Entity ur = tiledPlugin.getPluginEntityWithParams(row + 1, col + 1); - if (ur != null) { + int ur = tiledPlugin.getPluginEntityWithParams(row + 1, col + 1); + if (ur != -1) { c++; val += UR; } - Entity r = tiledPlugin.getPluginEntityWithParams(row, col + 1); - if (r != null) { + int r = tiledPlugin.getPluginEntityWithParams(row, col + 1); + if (r != -1) { c++; val += R; } - Entity dr = tiledPlugin.getPluginEntityWithParams(row - 1, col + 1); - if (dr != null) { + int dr = tiledPlugin.getPluginEntityWithParams(row - 1, col + 1); + if (dr != -1) { c++; val += DR; } - Entity d = tiledPlugin.getPluginEntityWithParams(row - 1, col); - if (d != null) { + int d = tiledPlugin.getPluginEntityWithParams(row - 1, col); + if (d != -1) { c++; val += D; } - Entity dl = tiledPlugin.getPluginEntityWithParams(row - 1, col - 1); - if (dl != null) { + int dl = tiledPlugin.getPluginEntityWithParams(row - 1, col - 1); + if (dl != -1) { c++; val += DL; } - Entity l = tiledPlugin.getPluginEntityWithParams(row, col - 1); - if (l != null) { + int l = tiledPlugin.getPluginEntityWithParams(row, col - 1); + if (l != -1) { c++; val += L; } diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/DeleteTileTool.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/DeleteTileTool.java index d51b461b..abbcdf13 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/DeleteTileTool.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/DeleteTileTool.java @@ -5,7 +5,6 @@ import java.util.Set; import org.puremvc.java.interfaces.INotification; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.TextureRegion; @@ -72,24 +71,24 @@ public class DeleteTileTool implements Tool { } @Override - public boolean itemMouseDown(Entity entity, float x, float y) { + public boolean itemMouseDown(int entity, float x, float y) { deleteEntityWithCoordinate(x, y); tiledPlugin.facade.sendNotification(TiledPlugin.AUTO_FILL_TILES); return true; } @Override - public void itemMouseUp(Entity entity, float x, float y) { + public void itemMouseUp(int entity, float x, float y) { tiledPlugin.facade.sendNotification(TiledPlugin.AUTO_FILL_TILES); } @Override - public void itemMouseDragged(Entity entity, float x, float y) { + public void itemMouseDragged(int entity, float x, float y) { deleteEntityWithCoordinate(x, y); } @Override - public void itemMouseDoubleClick(Entity entity, float x, float y) { + public void itemMouseDoubleClick(int entity, float x, float y) { } @@ -104,12 +103,12 @@ public class DeleteTileTool implements Tool { } @Override - public void keyDown(Entity entity, int keycode) { + public void keyDown(int entity, int keycode) { } @Override - public void keyUp(Entity entity, int keycode) { + public void keyUp(int entity, int keycode) { if(isHotswapped) { if(keycode == Input.Keys.SHIFT_LEFT || keycode == Input.Keys.SHIFT_RIGHT) { isHotswapped = false; @@ -118,8 +117,8 @@ public class DeleteTileTool implements Tool { } } - Set items = new HashSet<>(); - private void deleteEntity(Entity entity) { + Set items = new HashSet<>(); + private void deleteEntity(int entity) { if (tiledPlugin.isTile(entity) && tiledPlugin.isOnCurrentSelectedLayer(entity)) { items.clear(); items.add(entity); @@ -129,8 +128,8 @@ public class DeleteTileTool implements Tool { } private void deleteEntityWithCoordinate (float x, float y) { - Entity entity = tiledPlugin.getPluginEntityWithCoords(x, y); - if (entity != null) { + int entity = tiledPlugin.getPluginEntityWithCoords(x, y); + if (entity != -1) { deleteEntity(entity); } } diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/DrawTileTool.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/DrawTileTool.java index bf45e72b..3623c243 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/DrawTileTool.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/DrawTileTool.java @@ -2,7 +2,6 @@ package games.rednblack.editor.plugin.tiled.tools; import org.puremvc.java.interfaces.INotification; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.TextureRegion; @@ -91,9 +90,9 @@ public class DrawTileTool implements Tool { } @Override - public boolean itemMouseDown(Entity entity, float x, float y) { + public boolean itemMouseDown(int entity, float x, float y) { initGridThings(); - if (entity == null) + if (entity == -1) drawTile(x, y); else drawOnEntity(entity); @@ -101,23 +100,23 @@ public class DrawTileTool implements Tool { } @Override - public void itemMouseUp(Entity entity, float x, float y) { + public void itemMouseUp(int entity, float x, float y) { tiledPlugin.facade.sendNotification(TiledPlugin.AUTO_FILL_TILES); } @Override - public void itemMouseDragged(Entity entity, float x, float y) { + public void itemMouseDragged(int entity, float x, float y) { drawTile(x, y); } @Override - public void itemMouseDoubleClick(Entity entity, float x, float y) { + public void itemMouseDoubleClick(int entity, float x, float y) { if (!tiledPlugin.isOnCurrentSelectedLayer(entity)) return; - if (entity != null && tiledPlugin.isTile(entity)) { + if (entity != -1 && tiledPlugin.isTile(entity)) { //rotate TransformCommandBuilder commandBuilder = new TransformCommandBuilder(); - commandBuilder.begin(entity); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + commandBuilder.begin(entity, tiledPlugin.getAPI().getEngine()); + TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class, tiledPlugin.getAPI().getEngine()); if (transformComponent.scaleX > 0 && transformComponent.scaleY > 0) { commandBuilder.setScale(transformComponent.scaleX * -1f, transformComponent.scaleY); } else if (transformComponent.scaleX < 0 && transformComponent.scaleY > 0) { @@ -142,7 +141,7 @@ public class DrawTileTool implements Tool { } @Override - public void keyDown(Entity entity, int keycode) { + public void keyDown(int entity, int keycode) { if(keycode == Input.Keys.SHIFT_LEFT || keycode == Input.Keys.SHIFT_RIGHT) { tiledPlugin.getAPI().toolHotSwap(tiledPlugin.deleteTileTool); tiledPlugin.deleteTileTool.setHotSwapped(); @@ -150,7 +149,7 @@ public class DrawTileTool implements Tool { } @Override - public void keyUp(Entity entity, int keycode) { + public void keyUp(int entity, int keycode) { } @@ -191,7 +190,7 @@ public class DrawTileTool implements Tool { currentDrawStrategy.drawTile(newX, newY, row, column); } - private void drawOnEntity(Entity entity) { + private void drawOnEntity(int entity) { chooseDrawStrategy(); currentDrawStrategy.updateTile(entity); } diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/AutoTileDrawStrategy.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/AutoTileDrawStrategy.java index 60007bba..d9874793 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/AutoTileDrawStrategy.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/AutoTileDrawStrategy.java @@ -1,7 +1,5 @@ package games.rednblack.editor.plugin.tiled.tools.drawStrategy; -import com.badlogic.ashley.core.Entity; - import games.rednblack.editor.plugin.tiled.TiledPlugin; import games.rednblack.editor.plugin.tiled.data.AutoTileVO; import games.rednblack.editor.renderer.components.MainItemComponent; @@ -22,8 +20,8 @@ public class AutoTileDrawStrategy extends BasicDrawStrategy { @Override public void drawTile(float x, float y, int row, int column) { - Entity underneathTile = tiledPlugin.getPluginEntityWithParams(row, column); - if (underneathTile != null) { + int underneathTile = tiledPlugin.getPluginEntityWithParams(row, column); + if (underneathTile != -1) { updateTile(underneathTile); return; } @@ -32,7 +30,7 @@ public class AutoTileDrawStrategy extends BasicDrawStrategy { temp.set(x, y); tileToDraw = selectTileToDraw(); if (itemFactory.createSimpleImage(tileToDraw + TiledPlugin.AUTO_TILE_DRAW_SUFFIX, temp)) { - Entity imageEntity = itemFactory.getCreatedEntity(); + int imageEntity = itemFactory.getCreatedEntity(); postProcessEntity(imageEntity, x, y, row, column); } } @@ -64,10 +62,10 @@ public class AutoTileDrawStrategy extends BasicDrawStrategy { } @Override - public void updateTile(Entity entity) { + public void updateTile(int entity) { if (!checkValidTile(entity)) return; - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class, tiledPlugin.getAPI().getEngine()); if (tiledPlugin.getSelectedAutoTileName().equals(mainItemComponent.customVariables.getStringVariable(TiledPlugin.ORIG_AUTO_TILE))) { // we only allow an update when the auto-tiles is different // firstly, it does not make any sense to randomly reselect another alternative tile @@ -75,7 +73,7 @@ public class AutoTileDrawStrategy extends BasicDrawStrategy { return; } - TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class); + TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class, tiledPlugin.getAPI().getEngine()); if (textureRegionComponent != null && textureRegionComponent.regionName != null) { // there is already other tile under this one String selectedAutoTileName = selectTileToDraw(); @@ -94,10 +92,10 @@ public class AutoTileDrawStrategy extends BasicDrawStrategy { } @Override - protected void postProcessEntity(Entity entity, float x, float y, int row, int column) { + protected void postProcessEntity(int entity, float x, float y, int row, int column) { super.postProcessEntity(entity, x, y, row, column); - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class, tiledPlugin.getAPI().getEngine()); mainItemComponent.tags.add(TiledPlugin.AUTO_TILE_TAG); mainItemComponent.setCustomVars(TiledPlugin.REGION, tileToDraw); mainItemComponent.setCustomVars(TiledPlugin.ORIG_AUTO_TILE, tiledPlugin.getSelectedAutoTileName()); diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/BasicDrawStrategy.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/BasicDrawStrategy.java index 583a4e8a..91cea066 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/BasicDrawStrategy.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/BasicDrawStrategy.java @@ -1,6 +1,5 @@ package games.rednblack.editor.plugin.tiled.tools.drawStrategy; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import games.rednblack.editor.plugin.tiled.TiledPlugin; import games.rednblack.editor.renderer.components.MainItemComponent; @@ -15,20 +14,20 @@ public abstract class BasicDrawStrategy implements IDrawStrategy { tiledPlugin = plugin; } - protected void postProcessEntity(Entity entity, float x, float y, int row, int column) { - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + protected void postProcessEntity(int entity, float x, float y, int row, int column) { + MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class, tiledPlugin.getAPI().getEngine()); mainItemComponent.tags.add(TiledPlugin.TILE_TAG); mainItemComponent.setCustomVars(TiledPlugin.ROW, Integer.toString(row)); mainItemComponent.setCustomVars(TiledPlugin.COLUMN, Integer.toString(column)); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class, tiledPlugin.getAPI().getEngine()); transformComponent.x = x; transformComponent.y = y; } - protected boolean checkValidTile(Entity entity) { + protected boolean checkValidTile(int entity) { return tiledPlugin.isOnCurrentSelectedLayer(entity) && tiledPlugin.isTile(entity) - && ComponentRetriever.get(entity, MainItemComponent.class).entityType == tiledPlugin.getSelectedTileType(); + && ComponentRetriever.get(entity, MainItemComponent.class, tiledPlugin.getAPI().getEngine()).entityType == tiledPlugin.getSelectedTileType(); } } diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/IDrawStrategy.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/IDrawStrategy.java index 41ee1ad1..4010ad0a 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/IDrawStrategy.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/IDrawStrategy.java @@ -1,8 +1,6 @@ package games.rednblack.editor.plugin.tiled.tools.drawStrategy; -import com.badlogic.ashley.core.Entity; - public interface IDrawStrategy { void drawTile(float x, float y, int row, int column); - void updateTile(Entity entity); + void updateTile(int entity); } diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/ImageDrawStrategy.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/ImageDrawStrategy.java index 44ee762b..eb791323 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/ImageDrawStrategy.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/ImageDrawStrategy.java @@ -1,7 +1,5 @@ package games.rednblack.editor.plugin.tiled.tools.drawStrategy; -import com.badlogic.ashley.core.Entity; - import games.rednblack.editor.plugin.tiled.TiledPlugin; import games.rednblack.editor.renderer.components.MainItemComponent; import games.rednblack.editor.renderer.components.TextureRegionComponent; @@ -18,8 +16,8 @@ public class ImageDrawStrategy extends BasicDrawStrategy { @Override public void drawTile(float x, float y, int row, int column) { - Entity underneathTile = tiledPlugin.getPluginEntityWithParams(row, column); - if (underneathTile != null) { + int underneathTile = tiledPlugin.getPluginEntityWithParams(row, column); + if (underneathTile != -1) { updateTile(underneathTile); return; } @@ -27,16 +25,16 @@ public class ImageDrawStrategy extends BasicDrawStrategy { IFactory itemFactory = tiledPlugin.getAPI().getItemFactory(); temp.set(x, y); if (itemFactory.createSimpleImage(tiledPlugin.getSelectedTileName(), temp)) { - Entity imageEntity = itemFactory.getCreatedEntity(); + int imageEntity = itemFactory.getCreatedEntity(); postProcessEntity(imageEntity, x, y, row, column); } } @Override - public void updateTile(Entity entity) { + public void updateTile(int entity) { if (!checkValidTile(entity)) return; - TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class); + TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class, tiledPlugin.getAPI().getEngine()); if (textureRegionComponent != null && textureRegionComponent.regionName != null) { // there is already other tile under this one if (!textureRegionComponent.regionName.equals(tiledPlugin.getSelectedTileName())) { @@ -46,7 +44,7 @@ public class ImageDrawStrategy extends BasicDrawStrategy { replaceRegionCommandBuilder.setRegionName(region); replaceRegionCommandBuilder.execute(tiledPlugin.facade); - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class, tiledPlugin.getAPI().getEngine()); mainItemComponent.tags.remove(TiledPlugin.AUTO_TILE_TAG); mainItemComponent.removeCustomVars(TiledPlugin.REGION); } diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/SpineDrawStrategy.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/SpineDrawStrategy.java index 22f51459..f4db4045 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/SpineDrawStrategy.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/SpineDrawStrategy.java @@ -1,6 +1,5 @@ package games.rednblack.editor.plugin.tiled.tools.drawStrategy; -import com.badlogic.ashley.core.Entity; import com.esotericsoftware.spine.Skeleton; import com.esotericsoftware.spine.SkeletonData; import com.esotericsoftware.spine.SkeletonJson; @@ -21,8 +20,8 @@ public class SpineDrawStrategy extends BasicDrawStrategy { @Override public void drawTile(float x, float y, int row, int column) { - Entity underneathTile = tiledPlugin.getPluginEntityWithParams(row, column); - if (underneathTile != null) { + int underneathTile = tiledPlugin.getPluginEntityWithParams(row, column); + if (underneathTile != -1) { updateTile(underneathTile); return; } @@ -31,16 +30,16 @@ public class SpineDrawStrategy extends BasicDrawStrategy { temp.set(x, y); if (itemFactory.createSpineAnimation(tiledPlugin.getSelectedTileName(), temp)) { - Entity imageEntity = itemFactory.getCreatedEntity(); + int imageEntity = itemFactory.getCreatedEntity(); postProcessEntity(imageEntity, x, y, row, column); } } @Override - public void updateTile(Entity entity) { + public void updateTile(int entity) { if (!checkValidTile(entity)) return; - SpineDataComponent spineDataComponent = ComponentRetriever.get(entity, SpineDataComponent.class); + SpineDataComponent spineDataComponent = ComponentRetriever.get(entity, SpineDataComponent.class, tiledPlugin.getAPI().getEngine()); if (!spineDataComponent.animationName.equals(tiledPlugin.getSelectedTileName())) { replaceSpineCommandBuilder.begin(entity); String animName = tiledPlugin.getSelectedTileName(); diff --git a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/SpriteDrawStrategy.java b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/SpriteDrawStrategy.java index f7719b00..d4b74dbe 100644 --- a/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/SpriteDrawStrategy.java +++ b/plugin-tiled/src/main/java/games/rednblack/editor/plugin/tiled/tools/drawStrategy/SpriteDrawStrategy.java @@ -1,6 +1,5 @@ package games.rednblack.editor.plugin.tiled.tools.drawStrategy; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.utils.Array; import games.rednblack.editor.plugin.tiled.TiledPlugin; @@ -18,8 +17,8 @@ public class SpriteDrawStrategy extends BasicDrawStrategy { @Override public void drawTile(float x, float y, int row, int column) { - Entity underneathTile = tiledPlugin.getPluginEntityWithParams(row, column); - if (underneathTile != null) { + int underneathTile = tiledPlugin.getPluginEntityWithParams(row, column); + if (underneathTile != -1) { updateTile(underneathTile); return; } @@ -28,16 +27,16 @@ public class SpriteDrawStrategy extends BasicDrawStrategy { temp.set(x, y); if (itemFactory.createSpriteAnimation(tiledPlugin.getSelectedTileName(), temp)) { - Entity imageEntity = itemFactory.getCreatedEntity(); + int imageEntity = itemFactory.getCreatedEntity(); postProcessEntity(imageEntity, x, y, row, column); } } @Override - public void updateTile(Entity entity) { + public void updateTile(int entity) { if (!checkValidTile(entity)) return; - SpriteAnimationComponent spriteAnimationComponent = ComponentRetriever.get(entity, SpriteAnimationComponent.class); + SpriteAnimationComponent spriteAnimationComponent = ComponentRetriever.get(entity, SpriteAnimationComponent.class, tiledPlugin.getAPI().getEngine()); if (!spriteAnimationComponent.animationName.equals(tiledPlugin.getSelectedTileName())) { Array regions = getRegions(tiledPlugin.getSelectedTileName()); diff --git a/src/main/java/games/rednblack/editor/controller/commands/AddComponentToItemCommand.java b/src/main/java/games/rednblack/editor/controller/commands/AddComponentToItemCommand.java index d4a7d7fc..3aeefc62 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/AddComponentToItemCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/AddComponentToItemCommand.java @@ -1,7 +1,7 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Component; -import com.badlogic.ashley.core.Entity; +import com.artemis.Component; +import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; @@ -13,20 +13,20 @@ public class AddComponentToItemCommand extends EntityModifyRevertibleCommand { private static final String CLASS_NAME = "games.rednblack.editor.controller.commands.AddComponentToItemCommand"; public static final String DONE = CLASS_NAME + "DONE"; - private Entity entity; - private Component component; + private int entity; + private Class component; private void collectData() { Object[] payload = getNotification().getBody(); - entity = (Entity) payload[0]; - component = (Component) payload[1]; + entity = (int) payload[0]; + component = (Class) payload[1]; } @Override public void doAction() { collectData(); - entity.add(component); + Sandbox.getInstance().getEngine().edit(entity).create(component); HyperLap2DFacade.getInstance().sendNotification(DONE, entity); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); @@ -34,13 +34,14 @@ public class AddComponentToItemCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - entity.remove(component.getClass()); + Sandbox.getInstance().getEngine().edit(entity).remove(component); + Sandbox.getInstance().getEngine().process(); HyperLap2DFacade.getInstance().sendNotification(DONE, entity); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } - public static Object[] payload(Entity entity, Component component) { + public static Object[] payload(int entity, Class component) { Object[] payload = new Object[2]; payload[0] = entity; payload[1] = component; diff --git a/src/main/java/games/rednblack/editor/controller/commands/AddSelectionCommand.java b/src/main/java/games/rednblack/editor/controller/commands/AddSelectionCommand.java index 0f201e64..61ed8716 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/AddSelectionCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/AddSelectionCommand.java @@ -20,7 +20,6 @@ package games.rednblack.editor.controller.commands; import java.util.Set; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.utils.Array; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.editor.utils.runtime.EntityUtils; @@ -39,18 +38,18 @@ public class AddSelectionCommand extends RevertibleCommand { public void doAction() { cancel(); if(entityIds == null) { - Set items = getNotification().getBody(); + Set items = getNotification().getBody(); entityIds = EntityUtils.getEntityId(items); } - Set items = EntityUtils.getByUniqueId(entityIds); + Set items = EntityUtils.getByUniqueId(entityIds); Sandbox.getInstance().getSelector().addSelections(items); facade.sendNotification(DONE); } @Override public void undoAction() { - Set items = EntityUtils.getByUniqueId(entityIds); + Set items = EntityUtils.getByUniqueId(entityIds); Sandbox.getInstance().getSelector().releaseSelections(items); facade.sendNotification(DONE); } diff --git a/src/main/java/games/rednblack/editor/controller/commands/AddToLibraryCommand.java b/src/main/java/games/rednblack/editor/controller/commands/AddToLibraryCommand.java index 41ea2a23..da876d34 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/AddToLibraryCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/AddToLibraryCommand.java @@ -18,7 +18,7 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.proxy.ProjectManager; @@ -43,11 +43,11 @@ public class AddToLibraryCommand extends RevertibleCommand { public void doAction() { Object[] payload = getNotification().getBody(); - Entity item = ((Entity) payload[0]); + int item = ((int) payload[0]); entityId = EntityUtils.getEntityId(item); createdLibraryItemName = (String) payload[1]; - MainItemComponent mainItemComponent = ComponentRetriever.get(item, MainItemComponent.class); + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(item, MainItemComponent.class); if(createdLibraryItemName.length() > 0) { ProjectManager projectManager = HyperLap2DFacade.getInstance().retrieveProxy(ProjectManager.NAME); @@ -58,7 +58,7 @@ public class AddToLibraryCommand extends RevertibleCommand { } CompositeItemVO newVO = new CompositeItemVO(); - newVO.loadFromEntity(item); + newVO.loadFromEntity(item, sandbox.getEngine()); newVO.cleanIds(); libraryItems.put(createdLibraryItemName, newVO); @@ -86,14 +86,14 @@ public class AddToLibraryCommand extends RevertibleCommand { } facade.sendNotification(MsgAPI.LIBRARY_LIST_UPDATED); } else { - Entity entity = EntityUtils.getByUniqueId(entityId); - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + int entity = EntityUtils.getByUniqueId(entityId); + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(entity, MainItemComponent.class); mainItemComponent.libraryLink = prevName; facade.sendNotification(MsgAPI.ITEM_DATA_UPDATED); } } - public static Object payloadUnLink(Entity entity) { + public static Object payloadUnLink(int entity) { Object[] payload = new Object[2]; payload[0] = entity; payload[1] = ""; @@ -101,7 +101,7 @@ public class AddToLibraryCommand extends RevertibleCommand { return payload; } - public static Object payloadLink(Entity entity, String link) { + public static Object payloadLink(int entity, String link) { Object[] payload = new Object[2]; payload[0] = entity; payload[1] = link; diff --git a/src/main/java/games/rednblack/editor/controller/commands/ChangeOriginPointPosition.java b/src/main/java/games/rednblack/editor/controller/commands/ChangeOriginPointPosition.java index a3986501..80351608 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/ChangeOriginPointPosition.java +++ b/src/main/java/games/rednblack/editor/controller/commands/ChangeOriginPointPosition.java @@ -1,10 +1,10 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.SandboxCommand; import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.command.TransformCommandBuilder; import games.rednblack.editor.view.ui.validator.FloatInputValidator; import games.rednblack.h2d.common.view.ui.dialog.MultipleInputDialog; @@ -17,14 +17,14 @@ public class ChangeOriginPointPosition extends SandboxCommand { public void execute(INotification notification) { super.execute(notification); - Entity entity = notification.getBody(); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + int entity = notification.getBody(); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); MultipleInputDialog dialog = new MultipleInputDialog("Origin Position", new String[]{"X : ", "Y : "}, false, new FloatInputValidator(), new MultipleInputDialogListener() { @Override public void finished(String[] input) { TransformCommandBuilder commandBuilder = new TransformCommandBuilder(); - commandBuilder.begin(entity); + commandBuilder.begin(entity, sandbox.getEngine()); commandBuilder.setOrigin(Float.parseFloat(input[0]), Float.parseFloat(input[1])); commandBuilder.execute(HyperLap2DFacade.getInstance()); } diff --git a/src/main/java/games/rednblack/editor/controller/commands/ChangePolygonVertexPositionCommand.java b/src/main/java/games/rednblack/editor/controller/commands/ChangePolygonVertexPositionCommand.java index 82252d02..5b2f4d97 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/ChangePolygonVertexPositionCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/ChangePolygonVertexPositionCommand.java @@ -7,6 +7,7 @@ import games.rednblack.editor.controller.commands.component.UpdatePolygonDataCom import games.rednblack.editor.renderer.components.PolygonComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.poly.PolygonUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.ui.followers.PolygonFollower; import games.rednblack.editor.view.ui.validator.FloatInputValidator; import games.rednblack.h2d.common.MsgAPI; @@ -36,7 +37,7 @@ public class ChangePolygonVertexPositionCommand extends SandboxCommand { @Override public void finished(String[] input) { Vector2[] points = follower.getOriginalPoints().toArray(new Vector2[0]); - PolygonComponent polygonComponent = ComponentRetriever.get(follower.getEntity(), PolygonComponent.class); + PolygonComponent polygonComponent = SandboxComponentRetriever.get(follower.getEntity(), PolygonComponent.class); points[anchor].set(Float.parseFloat(input[0]), Float.parseFloat(input[1])); // check if any of near lines intersect diff --git a/src/main/java/games/rednblack/editor/controller/commands/CompositeCameraChangeCommand.java b/src/main/java/games/rednblack/editor/controller/commands/CompositeCameraChangeCommand.java index 78a0b085..5fd775b0 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/CompositeCameraChangeCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/CompositeCameraChangeCommand.java @@ -18,9 +18,9 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.utils.viewport.Viewport; import games.rednblack.editor.renderer.components.ParentNodeComponent; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.components.ViewPortComponent; @@ -43,8 +43,8 @@ public class CompositeCameraChangeCommand extends RevertibleCommand { @Override public void doAction() { cancel(); - Entity entity = getNotification().getBody(); - Entity oldEntity = sandbox.getCurrentViewingEntity(); + int entity = getNotification().getBody(); + int oldEntity = sandbox.getCurrentViewingEntity(); // check if entity is selected wasPrevSelected = sandbox.getSelector().isSelected(entity); @@ -52,21 +52,20 @@ public class CompositeCameraChangeCommand extends RevertibleCommand { if(enteringInto == null) enteringInto = EntityUtils.getEntityId(entity); if(previousViewEntityId == null) previousViewEntityId = EntityUtils.getEntityId(oldEntity); - ViewPortComponent viewPortComponent = ComponentRetriever.get(oldEntity, ViewPortComponent.class); + ViewPortComponent viewPortComponent = SandboxComponentRetriever.get(oldEntity, ViewPortComponent.class); Viewport currViewport = viewPortComponent.viewPort; - oldEntity.remove(ViewPortComponent.class); + sandbox.getEngine().edit(oldEntity).remove(ViewPortComponent.class); - ViewPortComponent newViewPortComponent = sandbox.getEngine().createComponent(ViewPortComponent.class); + ViewPortComponent newViewPortComponent = sandbox.getEngine().edit(entity).create(ViewPortComponent.class); newViewPortComponent.viewPort = currViewport; - entity.add(newViewPortComponent); sandbox.setCurrentViewingEntity(entity); sandbox.getSelector().clearSelections(); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - TransformComponent previousTransformComponent = ComponentRetriever.get(oldEntity, TransformComponent.class); - ParentNodeComponent parentNodeComponent = ComponentRetriever.get(entity, ParentNodeComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + TransformComponent previousTransformComponent = SandboxComponentRetriever.get(oldEntity, TransformComponent.class); + ParentNodeComponent parentNodeComponent = SandboxComponentRetriever.get(entity, ParentNodeComponent.class); if (parentNodeComponent == null || oldEntity != parentNodeComponent.parentEntity) previousTransformComponent.enableTransform(); transformComponent.disableTransform(); @@ -80,22 +79,21 @@ public class CompositeCameraChangeCommand extends RevertibleCommand { @Override public void undoAction() { - Entity oldEntity = EntityUtils.getByUniqueId(previousViewEntityId); - Entity currEntity = sandbox.getCurrentViewingEntity(); + int oldEntity = EntityUtils.getByUniqueId(previousViewEntityId); + int currEntity = sandbox.getCurrentViewingEntity(); - ViewPortComponent viewPortComponent = ComponentRetriever.get(currEntity, ViewPortComponent.class); + ViewPortComponent viewPortComponent = SandboxComponentRetriever.get(currEntity, ViewPortComponent.class); Viewport currViewport = viewPortComponent.viewPort; - currEntity.remove(ViewPortComponent.class); + sandbox.getEngine().edit(currEntity).remove(ViewPortComponent.class); - ViewPortComponent newViewPortComponent = sandbox.getEngine().createComponent(ViewPortComponent.class); + ViewPortComponent newViewPortComponent = sandbox.getEngine().edit(oldEntity).create(ViewPortComponent.class); newViewPortComponent.viewPort = currViewport; - oldEntity.add(newViewPortComponent); sandbox.setCurrentViewingEntity(oldEntity); facade.sendNotification(DONE, previousViewEntityId); - TransformComponent transformComponent = ComponentRetriever.get(currEntity, TransformComponent.class); - TransformComponent previousTransformComponent = ComponentRetriever.get(oldEntity, TransformComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(currEntity, TransformComponent.class); + TransformComponent previousTransformComponent = SandboxComponentRetriever.get(oldEntity, TransformComponent.class); previousTransformComponent.disableTransform(); transformComponent.enableTransform(); diff --git a/src/main/java/games/rednblack/editor/controller/commands/ConvertToButtonCommand.java b/src/main/java/games/rednblack/editor/controller/commands/ConvertToButtonCommand.java index 262f2800..44d1068c 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/ConvertToButtonCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/ConvertToButtonCommand.java @@ -18,7 +18,6 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.renderer.components.LayerMapComponent; import games.rednblack.editor.renderer.components.MainItemComponent; import games.rednblack.editor.renderer.components.additional.ButtonComponent; @@ -26,6 +25,7 @@ import games.rednblack.editor.renderer.data.LayerItemVO; import games.rednblack.editor.renderer.factory.EntityFactory; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import java.util.HashSet; @@ -37,10 +37,10 @@ public class ConvertToButtonCommand extends ConvertToCompositeCommand { @Override public void doAction() { - Entity entity; + int entity; - HashSet entities = (HashSet) sandbox.getSelector().getSelectedItems(); - Entity item = entities.iterator().next(); + HashSet entities = (HashSet) sandbox.getSelector().getSelectedItems(); + int item = entities.iterator().next(); if(entities.size() == 1 && EntityUtils.getType(item) == EntityFactory.COMPOSITE_TYPE) { entity = item; @@ -50,14 +50,14 @@ public class ConvertToButtonCommand extends ConvertToCompositeCommand { } //create layers - LayerMapComponent layerMapComponent = ComponentRetriever.get(entity, LayerMapComponent.class); + LayerMapComponent layerMapComponent = SandboxComponentRetriever.get(entity, LayerMapComponent.class); layerMapComponent.addLayer(new LayerItemVO("normal")); layerMapComponent.addLayer(new LayerItemVO("pressed")); // adding button logic - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(entity, MainItemComponent.class); mainItemComponent.tags.add("button"); - entity.add(new ButtonComponent()); + sandbox.getEngine().edit(entity).create(ButtonComponent.class); } @Override diff --git a/src/main/java/games/rednblack/editor/controller/commands/ConvertToCompositeCommand.java b/src/main/java/games/rednblack/editor/controller/commands/ConvertToCompositeCommand.java index cf3f6e5d..e3b72bfa 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/ConvertToCompositeCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/ConvertToCompositeCommand.java @@ -18,8 +18,8 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.factory.ItemFactory; @@ -50,14 +50,14 @@ public class ConvertToCompositeCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { // get entity list - HashSet entities = (HashSet) sandbox.getSelector().getSelectedItems(); + HashSet entities = (HashSet) sandbox.getSelector().getSelectedItems(); UILayerBoxMediator layerBoxMediator = facade.retrieveMediator(UILayerBoxMediator.NAME); if(layersBackup == null) { // backup layer data layersBackup = new HashMap<>(); - for(Entity entity: entities) { - ZIndexComponent zIndexComponent = ComponentRetriever.get(entity, ZIndexComponent.class); + for(int entity: entities) { + ZIndexComponent zIndexComponent = SandboxComponentRetriever.get(entity, ZIndexComponent.class); int tmpId = EntityUtils.getEntityId(entity); layersBackup.put(tmpId, zIndexComponent.layerName); } @@ -67,9 +67,8 @@ public class ConvertToCompositeCommand extends EntityModifyRevertibleCommand { Vector2 position = EntityUtils.getLeftBottomPoint(entities); //create new entity - Entity entity = ItemFactory.get().createCompositeItem(position); + int entity = ItemFactory.get().createCompositeItem(position); entityId = EntityUtils.getEntityId(entity); - sandbox.getEngine().addEntity(entity); // what was the parent component of entities parentEntityId = EntityUtils.getEntityId(sandbox.getCurrentViewingEntity()); @@ -78,26 +77,28 @@ public class ConvertToCompositeCommand extends EntityModifyRevertibleCommand { EntityUtils.changeParent(entities, entity); //reposition children - for(Entity childEntity: entities) { - TransformComponent transformComponent = ComponentRetriever.get(childEntity, TransformComponent.class); + for(int childEntity: entities) { + TransformComponent transformComponent = SandboxComponentRetriever.get(childEntity, TransformComponent.class); transformComponent.x -= position.x; transformComponent.y -=position.y; // put it on default layer - ZIndexComponent zIndexComponent = ComponentRetriever.get(childEntity, ZIndexComponent.class); + ZIndexComponent zIndexComponent = SandboxComponentRetriever.get(childEntity, ZIndexComponent.class); zIndexComponent.layerName = "Default"; } // recalculate composite size - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); Vector2 newSize = EntityUtils.getRightTopPoint(entities); dimensionsComponent.width = newSize.x; dimensionsComponent.height = newSize.y; dimensionsComponent.boundBox.set(0, 0, newSize.x, newSize.y); - ZIndexComponent zIndexComponent = ComponentRetriever.get(entity, ZIndexComponent.class); + ZIndexComponent zIndexComponent = SandboxComponentRetriever.get(entity, ZIndexComponent.class); zIndexComponent.layerName = layerBoxMediator.getCurrentSelectedLayerName(); + sandbox.getEngine().process(); + //let everyone know HyperLap2DFacade.getInstance().sendNotification(DONE); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.NEW_ITEM_ADDED, entity); @@ -110,11 +111,11 @@ public class ConvertToCompositeCommand extends EntityModifyRevertibleCommand { FollowersUIMediator followersUIMediator = HyperLap2DFacade.getInstance().retrieveMediator(FollowersUIMediator.NAME); //get the entity - Entity entity = EntityUtils.getByUniqueId(entityId); - Entity oldParentEntity = EntityUtils.getByUniqueId(parentEntityId); - if (entity == null || oldParentEntity == null) + int entity = EntityUtils.getByUniqueId(entityId); + int oldParentEntity = EntityUtils.getByUniqueId(parentEntityId); + if (entity == -1 || oldParentEntity == -1) return; - HashSet children = EntityUtils.getChildren(entity); + HashSet children = EntityUtils.getChildren(entity); if (children == null) return; // what will be the position diff of children? @@ -124,19 +125,20 @@ public class ConvertToCompositeCommand extends EntityModifyRevertibleCommand { EntityUtils.changeParent(children, oldParentEntity); //reposition children - for(Entity tmpEntity: children) { - TransformComponent transformComponent = ComponentRetriever.get(tmpEntity, TransformComponent.class); + for(int tmpEntity: children) { + TransformComponent transformComponent = SandboxComponentRetriever.get(tmpEntity, TransformComponent.class); transformComponent.x+=positionDiff.x; transformComponent.y+=positionDiff.y; // put layer data back - ZIndexComponent zIndexComponent = ComponentRetriever.get(entity, ZIndexComponent.class); + ZIndexComponent zIndexComponent = SandboxComponentRetriever.get(entity, ZIndexComponent.class); zIndexComponent.layerName = layersBackup.get(EntityUtils.getEntityId(tmpEntity)); } // remove composite followersUIMediator.removeFollower(entity); - sandbox.getEngine().removeEntity(entity); + sandbox.getEngine().delete(entity); + sandbox.getEngine().process(); HyperLap2DFacade.getInstance().sendNotification(DONE); diff --git a/src/main/java/games/rednblack/editor/controller/commands/CreateItemCommand.java b/src/main/java/games/rednblack/editor/controller/commands/CreateItemCommand.java index e7812b70..fcf998c8 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/CreateItemCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/CreateItemCommand.java @@ -18,8 +18,8 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.renderer.factory.EntityFactory; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.renderer.components.NodeComponent; @@ -43,11 +43,11 @@ public class CreateItemCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { - Entity entity = getNotification().getBody(); + int entity = getNotification().getBody(); if (serializedEntity != null) { EntityFactory factory = Sandbox.getInstance().sceneControl.sceneLoader.getEntityFactory(); - Entity parentEntity = Sandbox.getInstance().getCurrentViewingEntity(); + int parentEntity = Sandbox.getInstance().getCurrentViewingEntity(); entity = EntityUtils.getEntityFromJson(serializedEntity, entityType, factory, parentEntity); serializedEntity = null; } @@ -55,29 +55,29 @@ public class CreateItemCommand extends EntityModifyRevertibleCommand { entityId = EntityUtils.getEntityId(entity); entityType = EntityUtils.getType(entity); - sandbox.getEngine().addEntity(entity); - // z-index - NodeComponent nodeComponent = ComponentRetriever.get(Sandbox.getInstance().getCurrentViewingEntity(), NodeComponent.class); - ZIndexComponent zindexComponent = ComponentRetriever.get(entity, ZIndexComponent.class); + NodeComponent nodeComponent = SandboxComponentRetriever.get(Sandbox.getInstance().getCurrentViewingEntity(), NodeComponent.class); + ZIndexComponent zindexComponent = SandboxComponentRetriever.get(entity, ZIndexComponent.class); zindexComponent.setZIndex(nodeComponent.children.size); + sandbox.getEngine().process(); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.NEW_ITEM_ADDED, entity); - Set items = new HashSet<>(); + Set items = new HashSet<>(); items.add(entity); facade.sendNotification(MsgAPI.ACTION_SET_SELECTION, items); } @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); + int entity = EntityUtils.getByUniqueId(entityId); serializedEntity = EntityUtils.getJsonStringFromEntity(entity); FollowersUIMediator followersUIMediator = HyperLap2DFacade.getInstance().retrieveMediator(FollowersUIMediator.NAME); followersUIMediator.removeFollower(entity); - sandbox.getEngine().removeEntity(entity); + sandbox.getEngine().delete(entity); + sandbox.getEngine().process(); facade.sendNotification(MsgAPI.DELETE_ITEMS_COMMAND_DONE); } } diff --git a/src/main/java/games/rednblack/editor/controller/commands/CustomVariableModifyCommand.java b/src/main/java/games/rednblack/editor/controller/commands/CustomVariableModifyCommand.java index 8281e2c7..b4fe0ce4 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/CustomVariableModifyCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/CustomVariableModifyCommand.java @@ -1,9 +1,9 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.renderer.components.MainItemComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; /** * Created by CyberJoe on 11/6/2015. @@ -41,14 +41,14 @@ public class CustomVariableModifyCommand extends EntityModifyRevertibleCommand { } private void addVariable(String key, String value) { - Entity entity = EntityUtils.getByUniqueId(entityId); - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + int entity = EntityUtils.getByUniqueId(entityId); + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(entity, MainItemComponent.class); mainItemComponent.setCustomVars(key, value); } private void removeVariable(String key) { - Entity entity = EntityUtils.getByUniqueId(entityId); - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + int entity = EntityUtils.getByUniqueId(entityId); + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(entity, MainItemComponent.class); value = mainItemComponent.customVariables.getStringVariable(key); //storing the backup mainItemComponent.removeCustomVars(key); } @@ -57,7 +57,7 @@ public class CustomVariableModifyCommand extends EntityModifyRevertibleCommand { if(entityId == null) { // First time call, need to prepare the data and fetch payload Object[] payload = getNotification().getBody(); - Entity item = (Entity) payload[0]; + int item = (int) payload[0]; entityId = EntityUtils.getEntityId(item); key = (String) payload[2]; isAdding = false; @@ -68,7 +68,7 @@ public class CustomVariableModifyCommand extends EntityModifyRevertibleCommand { } } - public static Object addCustomVariable(Entity entity, String key, String value) { + public static Object addCustomVariable(int entity, String key, String value) { Object[] payload = new Object[4]; payload[0] = entity; payload[1] = true; // is adding type @@ -78,7 +78,7 @@ public class CustomVariableModifyCommand extends EntityModifyRevertibleCommand { return payload; } - public static Object removeCustomVariable(Entity entity, String key) { + public static Object removeCustomVariable(int entity, String key) { Object[] payload = new Object[3]; payload[0] = entity; payload[1] = true; diff --git a/src/main/java/games/rednblack/editor/controller/commands/CutItemsCommand.java b/src/main/java/games/rednblack/editor/controller/commands/CutItemsCommand.java index 03d8a3b3..eec2e310 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/CutItemsCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/CutItemsCommand.java @@ -18,8 +18,6 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; -import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Json; import games.rednblack.editor.utils.runtime.EntityUtils; import games.rednblack.h2d.common.MsgAPI; @@ -51,9 +49,10 @@ public class CutItemsCommand extends EntityModifyRevertibleCommand { public void undoAction() { Json json = new Json(); CompositeVO compositeVO = json.fromJson(CompositeVO.class, backup); - Set newEntitiesList = PasteItemsCommand.createEntitiesFromVO(compositeVO); + Set newEntitiesList = PasteItemsCommand.createEntitiesFromVO(compositeVO); - for (Entity entity : newEntitiesList) { + sandbox.getEngine().process(); + for (int entity : newEntitiesList) { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.NEW_ITEM_ADDED, entity); } diff --git a/src/main/java/games/rednblack/editor/controller/commands/DeleteItemsCommand.java b/src/main/java/games/rednblack/editor/controller/commands/DeleteItemsCommand.java index badc6f52..b637aa0b 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/DeleteItemsCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/DeleteItemsCommand.java @@ -18,7 +18,6 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Json; import games.rednblack.h2d.common.MsgAPI; @@ -39,11 +38,11 @@ public class DeleteItemsCommand extends EntityModifyRevertibleCommand { private Array entityIdsToDelete; private void backup() { - Set entitySet = new HashSet<>(); + Set entitySet = new HashSet<>(); if(entityIdsToDelete == null) { entityIdsToDelete = new Array<>(); entitySet = sandbox.getSelector().getSelectedItems(); - for(Entity entity: entitySet) { + for(int entity: entitySet) { entityIdsToDelete.add(EntityUtils.getEntityId(entity)); } } else { @@ -61,10 +60,11 @@ public class DeleteItemsCommand extends EntityModifyRevertibleCommand { FollowersUIMediator followersUIMediator = HyperLap2DFacade.getInstance().retrieveMediator(FollowersUIMediator.NAME); for (Integer entityId : entityIdsToDelete) { - Entity item = EntityUtils.getByUniqueId(entityId); + int item = EntityUtils.getByUniqueId(entityId); followersUIMediator.removeFollower(item); - sandbox.getEngine().removeEntity(item); + sandbox.getEngine().delete(item); } + sandbox.getEngine().process(); sandbox.getSelector().getCurrentSelection().clear(); @@ -75,18 +75,19 @@ public class DeleteItemsCommand extends EntityModifyRevertibleCommand { public void undoAction() { Json json = new Json(); CompositeVO compositeVO = json.fromJson(CompositeVO.class, backup); - Set newEntitiesList = PasteItemsCommand.createEntitiesFromVO(compositeVO); + Set newEntitiesList = PasteItemsCommand.createEntitiesFromVO(compositeVO); - for (Entity entity : newEntitiesList) { + sandbox.getEngine().process(); + for (int entity : newEntitiesList) { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.NEW_ITEM_ADDED, entity); } sandbox.getSelector().setSelections(newEntitiesList, true); } - public void setItemsToDelete(Set entities) { + public void setItemsToDelete(Set entities) { entityIdsToDelete = new Array<>(); - for(Entity entity: entities) { + for(int entity: entities) { entityIdsToDelete.add(EntityUtils.getEntityId(entity)); } } diff --git a/src/main/java/games/rednblack/editor/controller/commands/DeleteLayerAtomCommand.java b/src/main/java/games/rednblack/editor/controller/commands/DeleteLayerAtomCommand.java index 273753a9..514e0edd 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/DeleteLayerAtomCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/DeleteLayerAtomCommand.java @@ -1,9 +1,9 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.renderer.components.LayerMapComponent; import games.rednblack.editor.renderer.data.LayerItemVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; /** @@ -24,10 +24,8 @@ public class DeleteLayerAtomCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { - Entity viewingEntity = Sandbox.getInstance().getCurrentViewingEntity(); - LayerMapComponent layerMapComponent = ComponentRetriever.get(viewingEntity, LayerMapComponent.class); - - + int viewingEntity = Sandbox.getInstance().getCurrentViewingEntity(); + LayerMapComponent layerMapComponent = SandboxComponentRetriever.get(viewingEntity, LayerMapComponent.class); if(layerMapComponent.getLayers().size() > 1) { layerMapComponent.deleteLayer(layerName); @@ -38,8 +36,8 @@ public class DeleteLayerAtomCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity viewingEntity = Sandbox.getInstance().getCurrentViewingEntity(); - LayerMapComponent layerMapComponent = ComponentRetriever.get(viewingEntity, LayerMapComponent.class); + int viewingEntity = Sandbox.getInstance().getCurrentViewingEntity(); + LayerMapComponent layerMapComponent = SandboxComponentRetriever.get(viewingEntity, LayerMapComponent.class); layerMapComponent.addLayer(layerIndex, layerItemVO); } diff --git a/src/main/java/games/rednblack/editor/controller/commands/DeleteLayerCommand.java b/src/main/java/games/rednblack/editor/controller/commands/DeleteLayerCommand.java index 3e7d95a7..fe3c2c42 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/DeleteLayerCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/DeleteLayerCommand.java @@ -1,9 +1,9 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.renderer.components.NodeComponent; import games.rednblack.editor.renderer.components.ZIndexComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; import java.util.HashSet; @@ -40,13 +40,13 @@ public class DeleteLayerCommand extends TransactiveCommand { facade.sendNotification(UNDONE, layerName); } - public Set getItemsByLayerName(String layerName) { - Set result = new HashSet<>(); - Entity viewingEntity = Sandbox.getInstance().getCurrentViewingEntity(); - NodeComponent nodeComponent = ComponentRetriever.get(viewingEntity, NodeComponent.class); + public Set getItemsByLayerName(String layerName) { + Set result = new HashSet<>(); + int viewingEntity = Sandbox.getInstance().getCurrentViewingEntity(); + NodeComponent nodeComponent = SandboxComponentRetriever.get(viewingEntity, NodeComponent.class); for(int i = 0; i < nodeComponent.children.size; i++) { - Entity child = nodeComponent.children.get(i); - ZIndexComponent zIndexComponent = ComponentRetriever.get(child, ZIndexComponent.class); + int child = nodeComponent.children.get(i); + ZIndexComponent zIndexComponent = SandboxComponentRetriever.get(child, ZIndexComponent.class); if(zIndexComponent.layerName.equals(layerName)) { result.add(child); } diff --git a/src/main/java/games/rednblack/editor/controller/commands/DeletePolygonVertexCommand.java b/src/main/java/games/rednblack/editor/controller/commands/DeletePolygonVertexCommand.java index e8cb223d..330ca96a 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/DeletePolygonVertexCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/DeletePolygonVertexCommand.java @@ -8,6 +8,7 @@ import games.rednblack.editor.controller.commands.component.UpdatePolygonDataCom import games.rednblack.editor.renderer.components.PolygonComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.poly.PolygonUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.ui.followers.PolygonFollower; import games.rednblack.h2d.common.MsgAPI; import org.puremvc.java.interfaces.INotification; @@ -31,7 +32,7 @@ public class DeletePolygonVertexCommand extends SandboxCommand { PolygonFollower follower = (PolygonFollower) payload[0]; int anchor = (int) payload[1]; - PolygonComponent polygonComponent = ComponentRetriever.get(follower.getEntity(), PolygonComponent.class); + PolygonComponent polygonComponent = SandboxComponentRetriever.get(follower.getEntity(), PolygonComponent.class); if(polygonComponent == null || polygonComponent.vertices == null || polygonComponent.vertices.length == 0) return; if(follower.getOriginalPoints().size() <= 3) return; diff --git a/src/main/java/games/rednblack/editor/controller/commands/EntityModifyRevertibleCommand.java b/src/main/java/games/rednblack/editor/controller/commands/EntityModifyRevertibleCommand.java index 632e66d7..9841e807 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/EntityModifyRevertibleCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/EntityModifyRevertibleCommand.java @@ -18,8 +18,6 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Engine; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.utils.Array; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.proxy.ProjectManager; @@ -29,6 +27,7 @@ import games.rednblack.editor.renderer.components.NodeComponent; import games.rednblack.editor.renderer.data.CompositeItemVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import java.util.HashMap; @@ -50,10 +49,10 @@ public abstract class EntityModifyRevertibleCommand extends RevertibleCommand { protected void postChange() { Integer parentId = EntityUtils.getEntityId(sandbox.getCurrentViewingEntity()); - Entity entity = EntityUtils.getByUniqueId(parentId); + int entity = EntityUtils.getByUniqueId(parentId); // Update item library data if it was in library - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(entity, MainItemComponent.class); String link = mainItemComponent.libraryLink; if(link != null && link.length() > 0) { @@ -61,23 +60,23 @@ public abstract class EntityModifyRevertibleCommand extends RevertibleCommand { HashMap libraryItems = projectManager.currentProjectInfoVO.libraryItems; if (libraryItems.containsKey(mainItemComponent.libraryLink)) { CompositeItemVO itemVO = new CompositeItemVO(); - itemVO.loadFromEntity(entity); + itemVO.loadFromEntity(entity, sandbox.getEngine()); itemVO.cleanIds(); libraryItems.put(mainItemComponent.libraryLink, itemVO); } - Array linkedEntities = EntityUtils.getByLibraryLink(link); - for (Entity dependable : linkedEntities) { + Array linkedEntities = EntityUtils.getByLibraryLink(link); + for (int dependable : linkedEntities) { if(dependable == entity) continue; - NodeComponent nodeComponent = ComponentRetriever.get(dependable, NodeComponent.class); - for(Entity child: nodeComponent.children) { - sandbox.getEngine().removeEntity(child); + NodeComponent nodeComponent = SandboxComponentRetriever.get(dependable, NodeComponent.class); + for(int child: nodeComponent.children) { + sandbox.getEngine().delete(child); } nodeComponent.children.clear(); + sandbox.getEngine().process(); - Engine engine = sandbox.getSceneControl().sceneLoader.getEngine(); EntityFactory factory = sandbox.getSceneControl().sceneLoader.getEntityFactory(); - factory.initAllChildren(engine, dependable, libraryItems.get(link).composite); + factory.initAllChildren(dependable, libraryItems.get(link).composite); } } } diff --git a/src/main/java/games/rednblack/editor/controller/commands/ItemChildrenTransformCommand.java b/src/main/java/games/rednblack/editor/controller/commands/ItemChildrenTransformCommand.java index cc0baf6e..dac5ad18 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/ItemChildrenTransformCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/ItemChildrenTransformCommand.java @@ -1,8 +1,8 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.renderer.components.DimensionsComponent; @@ -20,19 +20,19 @@ public class ItemChildrenTransformCommand extends EntityModifyRevertibleCommand private HashMap prevPosMap = new HashMap<>(); private HashMap parentPositionAndSizeMap = new HashMap<>(); - private Entity entity; + private int entity; private Vector2 prevLo; private void doActionOnParent() { Array objects = getNotification().getBody(); Object[] itemData = objects.get(0); - Entity entity = (Entity) itemData[0]; + int entity = (int) itemData[0]; Vector2 newPos = (Vector2) itemData[1]; Vector2 newSize = (Vector2) itemData[2]; - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); Vector2 prevLocation = new Vector2(transformComponent.x, transformComponent.y); Vector2 prevSize = new Vector2(dimensionsComponent.width, dimensionsComponent.height); PositionSize positionSize = new PositionSize(prevLocation, prevSize); @@ -56,8 +56,8 @@ public class ItemChildrenTransformCommand extends EntityModifyRevertibleCommand Vector2 prevLocation = positionSize.position; Vector2 prevSize = positionSize.size; entity = EntityUtils.getByUniqueId(entityUniqueId); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); setState(transformComponent, prevLocation, dimensionsComponent, prevSize); // transformComponent.x = prevLocation.x; // transformComponent.y = prevLocation.y; @@ -77,9 +77,9 @@ public class ItemChildrenTransformCommand extends EntityModifyRevertibleCommand Array payload = notification.getBody(); for (int i = 1; i < payload.size; i++) { Object[] objectData = payload.get(i); - Entity entity = (Entity) objectData[0]; + int entity = (int) objectData[0]; Vector2 newPos = (Vector2) objectData[1]; - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); Vector2 prevPos = new Vector2(transformComponent.x, transformComponent.y); prevPosMap.put(EntityUtils.getEntityId(entity), prevPos); // EntityUtils.setPosition(entity, newPos); @@ -95,8 +95,8 @@ public class ItemChildrenTransformCommand extends EntityModifyRevertibleCommand for (Map.Entry entry : prevPosMap.entrySet()) { Integer entityUniqueId = entry.getKey(); Vector2 oldPosition = entry.getValue(); - Entity entity = EntityUtils.getByUniqueId(entityUniqueId); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + int entity = EntityUtils.getByUniqueId(entityUniqueId); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); transformComponent.x = oldPosition.x; transformComponent.y = oldPosition.y; } diff --git a/src/main/java/games/rednblack/editor/controller/commands/ItemTransformCommand.java b/src/main/java/games/rednblack/editor/controller/commands/ItemTransformCommand.java index 763e5b8c..2eec8d8d 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/ItemTransformCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/ItemTransformCommand.java @@ -1,12 +1,8 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; -import games.rednblack.editor.renderer.components.PolygonComponent; -import games.rednblack.editor.renderer.components.TextureRegionComponent; -import games.rednblack.editor.renderer.components.light.LightBodyComponent; -import games.rednblack.editor.renderer.components.physics.PhysicsBodyComponent; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.renderer.components.DimensionsComponent; @@ -26,7 +22,7 @@ public class ItemTransformCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { payload = getNotification().getBody(); - Entity entity = (Entity) payload.get(0); + int entity = (int) payload.get(0); Object[] newData = (Object[]) payload.get(2); entityId = EntityUtils.getEntityId(entity); @@ -37,8 +33,8 @@ public class ItemTransformCommand extends EntityModifyRevertibleCommand { Float newRotation = (Float) newData[3]; Vector2 newOrigin = (Vector2) newData[4]; - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); if(newPos != null) transformComponent.x = newPos.x; if(newPos != null) transformComponent.y = newPos.y; @@ -57,7 +53,7 @@ public class ItemTransformCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); + int entity = EntityUtils.getByUniqueId(entityId); Object[] prevData = (Object[]) payload.get(1); Vector2 prevPos = (Vector2) prevData[0]; @@ -66,8 +62,8 @@ public class ItemTransformCommand extends EntityModifyRevertibleCommand { Float prevRotation = (Float) prevData[3]; Vector2 prevOrigin = (Vector2) prevData[4]; - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); transformComponent.x = prevPos.x; transformComponent.y = prevPos.y; diff --git a/src/main/java/games/rednblack/editor/controller/commands/ItemsMoveCommand.java b/src/main/java/games/rednblack/editor/controller/commands/ItemsMoveCommand.java index ee564c09..675316ad 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/ItemsMoveCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/ItemsMoveCommand.java @@ -18,9 +18,9 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.renderer.components.TransformComponent; @@ -44,10 +44,10 @@ public class ItemsMoveCommand extends EntityModifyRevertibleCommand { for(int i = 0; i < payload.size; i++) { Object[] itemData = payload.get(i); - Entity entity = (Entity) itemData[0]; + int entity = (int) itemData[0]; Vector2 newLocation = (Vector2) itemData[1]; - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); Vector2 prevLocation = new Vector2(transformComponent.x, transformComponent.y); if(itemData.length > 2) { @@ -69,9 +69,9 @@ public class ItemsMoveCommand extends EntityModifyRevertibleCommand { Integer entityUniqueId = entry.getKey(); Vector2 prevLocation = entry.getValue(); - Entity entity = EntityUtils.getByUniqueId(entityUniqueId); + int entity = EntityUtils.getByUniqueId(entityUniqueId); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); transformComponent.x = prevLocation.x; transformComponent.y = prevLocation.y; diff --git a/src/main/java/games/rednblack/editor/controller/commands/LayerSwapCommand.java b/src/main/java/games/rednblack/editor/controller/commands/LayerSwapCommand.java index ef2d96e0..824683e0 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/LayerSwapCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/LayerSwapCommand.java @@ -18,10 +18,10 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.renderer.components.LayerMapComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; /** @@ -49,8 +49,8 @@ public class LayerSwapCommand extends EntityModifyRevertibleCommand { public void doAction() { backup(); - Entity viewingEntity = EntityUtils.getByUniqueId(entityId); - LayerMapComponent layerMapComponent = ComponentRetriever.get(viewingEntity, LayerMapComponent.class); + int viewingEntity = EntityUtils.getByUniqueId(entityId); + LayerMapComponent layerMapComponent = SandboxComponentRetriever.get(viewingEntity, LayerMapComponent.class); layerMapComponent.swap(sourceName, targetName); facade.sendNotification(DONE); @@ -59,8 +59,8 @@ public class LayerSwapCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity viewingEntity = EntityUtils.getByUniqueId(entityId); - LayerMapComponent layerMapComponent = ComponentRetriever.get(viewingEntity, LayerMapComponent.class); + int viewingEntity = EntityUtils.getByUniqueId(entityId); + LayerMapComponent layerMapComponent = SandboxComponentRetriever.get(viewingEntity, LayerMapComponent.class); layerMapComponent.swap(targetName, sourceName); facade.sendNotification(DONE); diff --git a/src/main/java/games/rednblack/editor/controller/commands/NewLayerCommand.java b/src/main/java/games/rednblack/editor/controller/commands/NewLayerCommand.java index 5ae95dd2..f8950032 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/NewLayerCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/NewLayerCommand.java @@ -1,9 +1,9 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.renderer.components.LayerMapComponent; import games.rednblack.editor.renderer.data.LayerItemVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; /** @@ -21,8 +21,8 @@ public class NewLayerCommand extends EntityModifyRevertibleCommand { int index = (int) payload[0]; layerName = (String) payload[1]; - Entity viewingEntity = Sandbox.getInstance().getCurrentViewingEntity(); - LayerMapComponent layerMapComponent = ComponentRetriever.get(viewingEntity, LayerMapComponent.class); + int viewingEntity = Sandbox.getInstance().getCurrentViewingEntity(); + LayerMapComponent layerMapComponent = SandboxComponentRetriever.get(viewingEntity, LayerMapComponent.class); LayerItemVO vo = new LayerItemVO(layerName); vo.isVisible = true; @@ -33,8 +33,8 @@ public class NewLayerCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity viewingEntity = Sandbox.getInstance().getCurrentViewingEntity(); - LayerMapComponent layerMapComponent = ComponentRetriever.get(viewingEntity, LayerMapComponent.class); + int viewingEntity = Sandbox.getInstance().getCurrentViewingEntity(); + LayerMapComponent layerMapComponent = SandboxComponentRetriever.get(viewingEntity, LayerMapComponent.class); layerMapComponent.deleteLayer(layerName); diff --git a/src/main/java/games/rednblack/editor/controller/commands/PasteItemsCommand.java b/src/main/java/games/rednblack/editor/controller/commands/PasteItemsCommand.java index 84eb7a02..b1ff2ea4 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/PasteItemsCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/PasteItemsCommand.java @@ -18,10 +18,10 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Json; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.renderer.components.TransformComponent; @@ -64,12 +64,13 @@ public class PasteItemsCommand extends EntityModifyRevertibleCommand { Json json = new Json(); CompositeVO compositeVO = json.fromJson(CompositeVO.class, (String) payload[1]); forceIdChange(compositeVO); - Set newEntitiesList = createEntitiesFromVO(compositeVO); - for (Entity entity : newEntitiesList) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + Set newEntitiesList = createEntitiesFromVO(compositeVO); + sandbox.getEngine().process(); + for (int entity : newEntitiesList) { + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); transformComponent.x += diff.x; transformComponent.y += diff.y; - ZIndexComponent zIndexComponent = ComponentRetriever.get(entity, ZIndexComponent.class); + ZIndexComponent zIndexComponent = SandboxComponentRetriever.get(entity, ZIndexComponent.class); // UILayerBoxMediator layerBoxMediator = facade.retrieveMediator(UILayerBoxMediator.NAME); zIndexComponent.layerName = layerBoxMediator.getCurrentSelectedLayerName(); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.NEW_ITEM_ADDED, entity); @@ -82,9 +83,10 @@ public class PasteItemsCommand extends EntityModifyRevertibleCommand { public void undoAction() { FollowersUIMediator followersUIMediator = HyperLap2DFacade.getInstance().retrieveMediator(FollowersUIMediator.NAME); for (Integer entityId : pastedEntityIds) { - Entity entity = EntityUtils.getByUniqueId(entityId); + int entity = EntityUtils.getByUniqueId(entityId); followersUIMediator.removeFollower(entity); - sandbox.getEngine().removeEntity(entity); + sandbox.getEngine().delete(entity); + sandbox.getEngine().process(); facade.sendNotification(MsgAPI.DELETE_ITEMS_COMMAND_DONE); } pastedEntityIds.clear(); @@ -98,62 +100,52 @@ public class PasteItemsCommand extends EntityModifyRevertibleCommand { } - public static Set createEntitiesFromVO(CompositeVO compositeVO) { - Set entities = new HashSet<>(); + public static Set createEntitiesFromVO(CompositeVO compositeVO) { + Set entities = new HashSet<>(); EntityFactory factory = Sandbox.getInstance().sceneControl.sceneLoader.getEntityFactory(); - Entity parentEntity = Sandbox.getInstance().getCurrentViewingEntity(); + int parentEntity = Sandbox.getInstance().getCurrentViewingEntity(); for (int i = 0; i < compositeVO.sImages.size(); i++) { - Entity child = factory.createEntity(parentEntity, compositeVO.sImages.get(i)); - Sandbox.getInstance().getEngine().addEntity(child); + int child = factory.createEntity(parentEntity, compositeVO.sImages.get(i)); entities.add(child); } for (int i = 0; i < compositeVO.sImage9patchs.size(); i++) { - Entity child = factory.createEntity(parentEntity, compositeVO.sImage9patchs.get(i)); - Sandbox.getInstance().getEngine().addEntity(child); + int child = factory.createEntity(parentEntity, compositeVO.sImage9patchs.get(i)); entities.add(child); } for (int i = 0; i < compositeVO.sLabels.size(); i++) { - Entity child = factory.createEntity(parentEntity, compositeVO.sLabels.get(i)); - Sandbox.getInstance().getEngine().addEntity(child); + int child = factory.createEntity(parentEntity, compositeVO.sLabels.get(i)); entities.add(child); } for (int i = 0; i < compositeVO.sParticleEffects.size(); i++) { - Entity child = factory.createEntity(parentEntity, compositeVO.sParticleEffects.get(i)); - Sandbox.getInstance().getEngine().addEntity(child); + int child = factory.createEntity(parentEntity, compositeVO.sParticleEffects.get(i)); entities.add(child); } for (int i = 0; i < compositeVO.sTalosVFX.size(); i++) { - Entity child = factory.createEntity(parentEntity, compositeVO.sTalosVFX.get(i)); - Sandbox.getInstance().getEngine().addEntity(child); + int child = factory.createEntity(parentEntity, compositeVO.sTalosVFX.get(i)); entities.add(child); } for (int i = 0; i < compositeVO.sLights.size(); i++) { - Entity child = factory.createEntity(parentEntity, compositeVO.sLights.get(i)); - Sandbox.getInstance().getEngine().addEntity(child); + int child = factory.createEntity(parentEntity, compositeVO.sLights.get(i)); entities.add(child); } for (int i = 0; i < compositeVO.sSpineAnimations.size(); i++) { - Entity child = factory.createEntity(parentEntity, compositeVO.sSpineAnimations.get(i)); - Sandbox.getInstance().getEngine().addEntity(child); + int child = factory.createEntity(parentEntity, compositeVO.sSpineAnimations.get(i)); entities.add(child); } for (int i = 0; i < compositeVO.sSpriteAnimations.size(); i++) { - Entity child = factory.createEntity(parentEntity, compositeVO.sSpriteAnimations.get(i)); - Sandbox.getInstance().getEngine().addEntity(child); + int child = factory.createEntity(parentEntity, compositeVO.sSpriteAnimations.get(i)); entities.add(child); } for (int i = 0; i < compositeVO.sColorPrimitives.size(); i++) { - Entity child = factory.createEntity(parentEntity, compositeVO.sColorPrimitives.get(i)); - Sandbox.getInstance().getEngine().addEntity(child); + int child = factory.createEntity(parentEntity, compositeVO.sColorPrimitives.get(i)); entities.add(child); } for (int i = 0; i < compositeVO.sComposites.size(); i++) { - Entity child = factory.createEntity(parentEntity, compositeVO.sComposites.get(i)); - Sandbox.getInstance().getEngine().addEntity(child); + int child = factory.createEntity(parentEntity, compositeVO.sComposites.get(i)); entities.add(child); - factory.initAllChildren(Sandbox.getInstance().getEngine(), child, compositeVO.sComposites.get(i).composite); + factory.initAllChildren(child, compositeVO.sComposites.get(i).composite); } return entities; diff --git a/src/main/java/games/rednblack/editor/controller/commands/ReleaseSelectionCommand.java b/src/main/java/games/rednblack/editor/controller/commands/ReleaseSelectionCommand.java index 0fd57f94..08b6cc35 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/ReleaseSelectionCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/ReleaseSelectionCommand.java @@ -22,7 +22,6 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.utils.Array; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.editor.utils.runtime.EntityUtils; @@ -40,7 +39,7 @@ public class ReleaseSelectionCommand extends RevertibleCommand { @Override public void doAction() { cancel(); - Set items = new HashSet<>(getNotification().>getBody()); + Set items = new HashSet<>(getNotification().>getBody()); Sandbox.getInstance().getSelector().releaseSelections(items); entityIds = EntityUtils.getEntityId(items); @@ -50,7 +49,7 @@ public class ReleaseSelectionCommand extends RevertibleCommand { @Override public void undoAction() { - Set items = EntityUtils.getByUniqueId(entityIds); + Set items = EntityUtils.getByUniqueId(entityIds); Sandbox.getInstance().getSelector().addSelections(items); facade.sendNotification(DONE); diff --git a/src/main/java/games/rednblack/editor/controller/commands/RemoveComponentFromItemCommand.java b/src/main/java/games/rednblack/editor/controller/commands/RemoveComponentFromItemCommand.java index f9b69140..c8f72024 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/RemoveComponentFromItemCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/RemoveComponentFromItemCommand.java @@ -1,9 +1,10 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Component; -import com.badlogic.ashley.core.Entity; -import games.rednblack.editor.renderer.components.RemovableComponent; +import com.artemis.Component; +import games.rednblack.editor.renderer.components.RemovableObject; +import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.ComponentCloner; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; @@ -15,23 +16,25 @@ public class RemoveComponentFromItemCommand extends EntityModifyRevertibleComman private static final String CLASS_NAME = "games.rednblack.editor.controller.commands.RemoveComponentFromItemCommand"; public static final String DONE = CLASS_NAME + "DONE"; - private Entity entity; + private int entity; private Component component; + private Class componentClass; private void collectData() { Object[] payload = getNotification().getBody(); - entity = (Entity) payload[0]; - Class componentClass = (Class) payload[1]; - component = ComponentCloner.get(entity.getComponent(componentClass)); + entity = (int) payload[0]; + componentClass = (Class) payload[1]; + component = ComponentCloner.get(SandboxComponentRetriever.get(entity, componentClass)); } @Override public void doAction() { collectData(); - if (component instanceof RemovableComponent) { - ((RemovableComponent) component).onRemove(); + if (component instanceof RemovableObject) { + ((RemovableObject) component).onRemove(); } - entity.remove(component.getClass()); + sandbox.getEngine().edit(entity).remove(component.getClass()); + sandbox.getEngine().process(); HyperLap2DFacade.getInstance().sendNotification(DONE, entity); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); @@ -39,15 +42,16 @@ public class RemoveComponentFromItemCommand extends EntityModifyRevertibleComman @Override public void undoAction() { - if (entity.getComponent(component.getClass()) == null) { - entity.add(component); + if (SandboxComponentRetriever.get(entity, component.getClass()) == null) { + Component newComponent = sandbox.getEngine().edit(entity).create(componentClass); + ComponentCloner.set(newComponent, component); } HyperLap2DFacade.getInstance().sendNotification(DONE, entity); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } - public static Object[] payload(Entity entity, Class componentClass) { + public static Object[] payload(int entity, Class componentClass) { Object[] payload = new Object[2]; payload[0] = entity; payload[1] = componentClass; diff --git a/src/main/java/games/rednblack/editor/controller/commands/RenameLayerCommand.java b/src/main/java/games/rednblack/editor/controller/commands/RenameLayerCommand.java index a0cef5d7..bb0623f3 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/RenameLayerCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/RenameLayerCommand.java @@ -18,11 +18,11 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.renderer.components.LayerMapComponent; import games.rednblack.editor.renderer.components.NodeComponent; import games.rednblack.editor.renderer.components.ZIndexComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; /** @@ -57,9 +57,9 @@ public class RenameLayerCommand extends EntityModifyRevertibleCommand { } private void renameLayer(String fromName, String toName) { - Entity viewEntity = Sandbox.getInstance().getCurrentViewingEntity(); - NodeComponent nodeComponent = ComponentRetriever.get(viewEntity, NodeComponent.class); - LayerMapComponent layerMapComponent = ComponentRetriever.get(viewEntity, LayerMapComponent.class); + int viewEntity = Sandbox.getInstance().getCurrentViewingEntity(); + NodeComponent nodeComponent = SandboxComponentRetriever.get(viewEntity, NodeComponent.class); + LayerMapComponent layerMapComponent = SandboxComponentRetriever.get(viewEntity, LayerMapComponent.class); if (layerMapComponent.getLayer(toName) != null) { cancel(); @@ -68,8 +68,8 @@ public class RenameLayerCommand extends EntityModifyRevertibleCommand { layerMapComponent.rename(fromName, toName); - for(Entity childEntity: nodeComponent.children) { - ZIndexComponent zIndexComponent = ComponentRetriever.get(childEntity, ZIndexComponent.class); + for(int childEntity: nodeComponent.children) { + ZIndexComponent zIndexComponent = SandboxComponentRetriever.get(childEntity, ZIndexComponent.class); if(zIndexComponent.layerName.equals(fromName)) { zIndexComponent.layerName = toName; } diff --git a/src/main/java/games/rednblack/editor/controller/commands/SetSelectionCommand.java b/src/main/java/games/rednblack/editor/controller/commands/SetSelectionCommand.java index 31b2a10f..297b5221 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/SetSelectionCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/SetSelectionCommand.java @@ -22,8 +22,8 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Set; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.utils.Array; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.editor.renderer.components.NodeComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; @@ -42,10 +42,10 @@ public class SetSelectionCommand extends RevertibleCommand { @Override public void doAction() { cancel(); - HashSet previousSelection = new HashSet<>(Sandbox.getInstance().getSelector().getSelectedItems()); + HashSet previousSelection = new HashSet<>(Sandbox.getInstance().getSelector().getSelectedItems()); previousSelectionIds = EntityUtils.getEntityId(previousSelection); - Set items = getNotification().getBody(); + Set items = getNotification().getBody(); if(items == null) { // deselect all @@ -55,10 +55,10 @@ public class SetSelectionCommand extends RevertibleCommand { } // check if items are in viewable element, if no - cancel - NodeComponent nodeComponent = ComponentRetriever.get(sandbox.getCurrentViewingEntity(), NodeComponent.class); - for (Iterator iterator = items.iterator(); iterator.hasNext();) { - Entity item = iterator.next(); - if(!nodeComponent.children.contains(item, true)) { + NodeComponent nodeComponent = SandboxComponentRetriever.get(sandbox.getCurrentViewingEntity(), NodeComponent.class); + for (Iterator iterator = items.iterator(); iterator.hasNext();) { + int item = iterator.next(); + if(!nodeComponent.children.contains(item, false)) { iterator.remove(); } } diff --git a/src/main/java/games/rednblack/editor/controller/commands/UpdateEntityComponentsCommand.java b/src/main/java/games/rednblack/editor/controller/commands/UpdateEntityComponentsCommand.java index d0f9ee9d..61d2527f 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/UpdateEntityComponentsCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/UpdateEntityComponentsCommand.java @@ -18,9 +18,9 @@ package games.rednblack.editor.controller.commands; -import com.badlogic.ashley.core.Component; -import com.badlogic.ashley.core.Entity; +import com.artemis.Component; import com.badlogic.gdx.utils.Array; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.renderer.utils.ComponentRetriever; @@ -39,13 +39,13 @@ public class UpdateEntityComponentsCommand extends EntityModifyRevertibleCommand public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; entityId = EntityUtils.getEntityId(entity); Array components = (Array) payload[1]; for(int i = 0; i < components.size; i++) { //backup the original component - Component originalComponent = ComponentRetriever.get(entity, components.get(i).getClass()); + Component originalComponent = SandboxComponentRetriever.get(entity, components.get(i).getClass()); backupComponents.add(ComponentCloner.get(originalComponent)); //now modify the entity component from provided data @@ -59,9 +59,9 @@ public class UpdateEntityComponentsCommand extends EntityModifyRevertibleCommand @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); + int entity = EntityUtils.getByUniqueId(entityId); for(int i = 0; i < backupComponents.size; i++) { - Component entityComponent = ComponentRetriever.get(entity, backupComponents.get(i).getClass()); + Component entityComponent = SandboxComponentRetriever.get(entity, backupComponents.get(i).getClass()); ComponentCloner.set(entityComponent, backupComponents.get(i)); } diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/ReplaceRegionCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/ReplaceRegionCommand.java index 6ddb466c..c70ab466 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/ReplaceRegionCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/ReplaceRegionCommand.java @@ -1,6 +1,5 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.graphics.g2d.TextureRegion; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; @@ -10,6 +9,7 @@ import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.data.ProjectInfoVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.h2d.common.MsgAPI; @@ -22,15 +22,15 @@ public class ReplaceRegionCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; String regionName = (String) payload[1]; TextureRegion region = (TextureRegion) payload[2]; entityId = EntityUtils.getEntityId(entity); - TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class); - DimensionsComponent size = ComponentRetriever.get(entity, DimensionsComponent.class); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + TextureRegionComponent textureRegionComponent = SandboxComponentRetriever.get(entity, TextureRegionComponent.class); + DimensionsComponent size = SandboxComponentRetriever.get(entity, DimensionsComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); backupRegionName = textureRegionComponent.regionName; backupRegion = textureRegionComponent.region; @@ -50,11 +50,11 @@ public class ReplaceRegionCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); + int entity = EntityUtils.getByUniqueId(entityId); - TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class); - DimensionsComponent size = ComponentRetriever.get(entity, DimensionsComponent.class); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + TextureRegionComponent textureRegionComponent = SandboxComponentRetriever.get(entity, TextureRegionComponent.class); + DimensionsComponent size = SandboxComponentRetriever.get(entity, DimensionsComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); textureRegionComponent.regionName = backupRegionName; textureRegionComponent.region = backupRegion; diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/ReplaceSpineCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/ReplaceSpineCommand.java index ff01a67b..225f468e 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/ReplaceSpineCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/ReplaceSpineCommand.java @@ -1,6 +1,5 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import com.esotericsoftware.spine.*; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; @@ -9,6 +8,7 @@ import games.rednblack.editor.renderer.components.SpineDataComponent; import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.h2d.extention.spine.SpineObjectComponent; @@ -22,7 +22,7 @@ public class ReplaceSpineCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; String animName = (String) payload[1]; SkeletonJson skeletonJson = (SkeletonJson) payload[2]; Skeleton skeleton = (Skeleton) payload[3]; @@ -30,10 +30,10 @@ public class ReplaceSpineCommand extends EntityModifyRevertibleCommand { entityId = EntityUtils.getEntityId(entity); - SpineDataComponent spineDataComponent = ComponentRetriever.get(entity, SpineDataComponent.class); - SpineObjectComponent spineObjectComponent = ComponentRetriever.get(entity, SpineObjectComponent.class); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + SpineDataComponent spineDataComponent = SandboxComponentRetriever.get(entity, SpineDataComponent.class); + SpineObjectComponent spineObjectComponent = SandboxComponentRetriever.get(entity, SpineObjectComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); backupAnimName = spineDataComponent.animationName; backupSkeletonJson = spineObjectComponent.skeletonJson; @@ -63,12 +63,12 @@ public class ReplaceSpineCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); + int entity = EntityUtils.getByUniqueId(entityId); - SpineDataComponent spineDataComponent = ComponentRetriever.get(entity, SpineDataComponent.class); - SpineObjectComponent spineObjectComponent = ComponentRetriever.get(entity, SpineObjectComponent.class); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + SpineDataComponent spineDataComponent = SandboxComponentRetriever.get(entity, SpineDataComponent.class); + SpineObjectComponent spineObjectComponent = SandboxComponentRetriever.get(entity, SpineObjectComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); spineDataComponent.animationName = backupAnimName; spineObjectComponent.skeletonJson = backupSkeletonJson; diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/ReplaceSpriteAnimationCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/ReplaceSpriteAnimationCommand.java index 2d8eb4af..2f81422e 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/ReplaceSpriteAnimationCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/ReplaceSpriteAnimationCommand.java @@ -1,6 +1,5 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.graphics.g2d.Animation; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.utils.Array; @@ -15,6 +14,7 @@ import games.rednblack.editor.renderer.data.FrameRange; import games.rednblack.editor.renderer.data.ProjectInfoVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.h2d.common.MsgAPI; @@ -27,17 +27,17 @@ public class ReplaceSpriteAnimationCommand extends EntityModifyRevertibleCommand @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; String animName = (String) payload[1]; Array regions = (Array) payload[2]; entityId = EntityUtils.getEntityId(entity); - SpriteAnimationComponent spriteAnimationComponent = ComponentRetriever.get(entity, SpriteAnimationComponent.class); - SpriteAnimationStateComponent spriteAnimationStateComponent = ComponentRetriever.get(entity, SpriteAnimationStateComponent.class); - TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class); - DimensionsComponent size = ComponentRetriever.get(entity, DimensionsComponent.class); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + SpriteAnimationComponent spriteAnimationComponent = SandboxComponentRetriever.get(entity, SpriteAnimationComponent.class); + SpriteAnimationStateComponent spriteAnimationStateComponent = SandboxComponentRetriever.get(entity, SpriteAnimationStateComponent.class); + TextureRegionComponent textureRegionComponent = SandboxComponentRetriever.get(entity, TextureRegionComponent.class); + DimensionsComponent size = SandboxComponentRetriever.get(entity, DimensionsComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); backupAnimName = spriteAnimationComponent.animationName; backupAnimRegions = spriteAnimationStateComponent.allRegions; @@ -67,13 +67,13 @@ public class ReplaceSpriteAnimationCommand extends EntityModifyRevertibleCommand @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); + int entity = EntityUtils.getByUniqueId(entityId); - SpriteAnimationComponent spriteAnimationComponent = ComponentRetriever.get(entity, SpriteAnimationComponent.class); - SpriteAnimationStateComponent spriteAnimationStateComponent = ComponentRetriever.get(entity, SpriteAnimationStateComponent.class); - TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class); - DimensionsComponent size = ComponentRetriever.get(entity, DimensionsComponent.class); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + SpriteAnimationComponent spriteAnimationComponent = SandboxComponentRetriever.get(entity, SpriteAnimationComponent.class); + SpriteAnimationStateComponent spriteAnimationStateComponent = SandboxComponentRetriever.get(entity, SpriteAnimationStateComponent.class); + TextureRegionComponent textureRegionComponent = SandboxComponentRetriever.get(entity, TextureRegionComponent.class); + DimensionsComponent size = SandboxComponentRetriever.get(entity, DimensionsComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); spriteAnimationComponent.animationName = backupAnimName; spriteAnimationComponent.frameRangeMap.clear(); diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateCompositeDataCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateCompositeDataCommand.java index c72f639e..a7cb80e2 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateCompositeDataCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateCompositeDataCommand.java @@ -1,6 +1,5 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; import games.rednblack.editor.renderer.components.CompositeTransformComponent; @@ -8,6 +7,7 @@ import games.rednblack.editor.renderer.components.MainItemComponent; import games.rednblack.editor.renderer.data.CompositeItemVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; public class UpdateCompositeDataCommand extends EntityModifyRevertibleCommand { @@ -17,14 +17,14 @@ public class UpdateCompositeDataCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; CompositeItemVO vo = (CompositeItemVO) payload[1]; entityId = EntityUtils.getEntityId(entity); backup = new CompositeItemVO(); - backup.loadFromEntity(entity); + backup.loadFromEntity(entity, sandbox.getEngine()); - CompositeTransformComponent transformComponent = ComponentRetriever.get(entity, CompositeTransformComponent.class); + CompositeTransformComponent transformComponent = SandboxComponentRetriever.get(entity, CompositeTransformComponent.class); transformComponent.automaticResize = vo.automaticResize; transformComponent.scissorsEnabled = vo.scissorsEnabled; transformComponent.renderToFBO = vo.renderToFBO; @@ -32,16 +32,16 @@ public class UpdateCompositeDataCommand extends EntityModifyRevertibleCommand { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); if (!transformComponent.renderToFBO) { - String tag = ComponentRetriever.get(entity, MainItemComponent.class).itemIdentifier; + String tag = SandboxComponentRetriever.get(entity, MainItemComponent.class).itemIdentifier; sandbox.getSceneControl().sceneLoader.getFrameBufferManager().dispose(tag); } } @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); + int entity = EntityUtils.getByUniqueId(entityId); - CompositeTransformComponent transformComponent = ComponentRetriever.get(entity, CompositeTransformComponent.class); + CompositeTransformComponent transformComponent = SandboxComponentRetriever.get(entity, CompositeTransformComponent.class); transformComponent.automaticResize = backup.automaticResize; transformComponent.scissorsEnabled = backup.scissorsEnabled; transformComponent.renderToFBO = backup.renderToFBO; @@ -49,12 +49,12 @@ public class UpdateCompositeDataCommand extends EntityModifyRevertibleCommand { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); if (!transformComponent.renderToFBO) { - String tag = ComponentRetriever.get(entity, MainItemComponent.class).itemIdentifier; + String tag = SandboxComponentRetriever.get(entity, MainItemComponent.class).itemIdentifier; sandbox.getSceneControl().sceneLoader.getFrameBufferManager().dispose(tag); } } - public static Object payload(Entity entity, CompositeItemVO vo) { + public static Object payload(int entity, CompositeItemVO vo) { Object[] payload = new Object[2]; payload[0] = entity; payload[1] = vo; diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateImageItemDataCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateImageItemDataCommand.java index 9d06cbf8..962fe195 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateImageItemDataCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateImageItemDataCommand.java @@ -1,15 +1,13 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; import games.rednblack.editor.renderer.components.DimensionsComponent; -import games.rednblack.editor.renderer.components.PolygonComponent; import games.rednblack.editor.renderer.components.TextureRegionComponent; -import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.data.SimpleImageVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; public class UpdateImageItemDataCommand extends EntityModifyRevertibleCommand { @@ -20,11 +18,11 @@ public class UpdateImageItemDataCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; SimpleImageVO vo = (SimpleImageVO) payload[1]; entityId = EntityUtils.getEntityId(entity); - TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class); + TextureRegionComponent textureRegionComponent = SandboxComponentRetriever.get(entity, TextureRegionComponent.class); backup = new SimpleImageVO(); backup.loadFromComponent(textureRegionComponent); @@ -39,8 +37,8 @@ public class UpdateImageItemDataCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); - TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class); + int entity = EntityUtils.getByUniqueId(entityId); + TextureRegionComponent textureRegionComponent = SandboxComponentRetriever.get(entity, TextureRegionComponent.class); textureRegionComponent.isRepeat = backup.isRepeat; textureRegionComponent.isPolygon = backup.isPolygon; @@ -50,9 +48,9 @@ public class UpdateImageItemDataCommand extends EntityModifyRevertibleCommand { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } - private void updateEntity(Entity entity) { - TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + private void updateEntity(int entity) { + TextureRegionComponent textureRegionComponent = SandboxComponentRetriever.get(entity, TextureRegionComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); if (!textureRegionComponent.isPolygon) { dimensionsComponent.polygon = null; @@ -61,7 +59,7 @@ public class UpdateImageItemDataCommand extends EntityModifyRevertibleCommand { textureRegionComponent.scheduleRefresh(); } - public static Object payload(Entity entity, SimpleImageVO vo) { + public static Object payload(int entity, SimpleImageVO vo) { Object[] payload = new Object[2]; payload[0] = entity; payload[1] = vo; diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateLabelDataCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateLabelDataCommand.java index b81519de..6a6c4247 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateLabelDataCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateLabelDataCommand.java @@ -18,8 +18,8 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.scenes.scene2d.ui.Label; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; import games.rednblack.editor.renderer.components.label.LabelComponent; @@ -48,10 +48,10 @@ public class UpdateLabelDataCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; entityId = EntityUtils.getEntityId(entity); - LabelComponent labelComponent = ComponentRetriever.get(entity, LabelComponent.class); + LabelComponent labelComponent = SandboxComponentRetriever.get(entity, LabelComponent.class); this.prevFontName = labelComponent.fontName; this.prevFontSize = labelComponent.fontSize; @@ -85,8 +85,8 @@ public class UpdateLabelDataCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - final Entity entity = EntityUtils.getByUniqueId(entityId); - final LabelComponent labelComponent = ComponentRetriever.get(entity, LabelComponent.class); + final int entity = EntityUtils.getByUniqueId(entityId); + final LabelComponent labelComponent = SandboxComponentRetriever.get(entity, LabelComponent.class); labelComponent.fontName = prevFontName; labelComponent.fontSize = prevFontSize; diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateLightBodyDataCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateLightBodyDataCommand.java index d4cdb59d..d7867e9e 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateLightBodyDataCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateLightBodyDataCommand.java @@ -1,12 +1,12 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; import games.rednblack.editor.renderer.components.light.LightBodyComponent; import games.rednblack.editor.renderer.data.LightBodyDataVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; public class UpdateLightBodyDataCommand extends EntityModifyRevertibleCommand { @@ -17,11 +17,11 @@ public class UpdateLightBodyDataCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; LightBodyDataVO vo = (LightBodyDataVO) payload[1]; entityId = EntityUtils.getEntityId(entity); - LightBodyComponent lightComponent = ComponentRetriever.get(entity, LightBodyComponent.class); + LightBodyComponent lightComponent = SandboxComponentRetriever.get(entity, LightBodyComponent.class); backup = new LightBodyDataVO(); backup.loadFromComponent(lightComponent); @@ -47,8 +47,8 @@ public class UpdateLightBodyDataCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); - LightBodyComponent lightComponent = ComponentRetriever.get(entity, LightBodyComponent.class); + int entity = EntityUtils.getByUniqueId(entityId); + LightBodyComponent lightComponent = SandboxComponentRetriever.get(entity, LightBodyComponent.class); lightComponent.rayDirection = backup.rayDirection; lightComponent.distance = backup.distance; @@ -69,7 +69,7 @@ public class UpdateLightBodyDataCommand extends EntityModifyRevertibleCommand { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } - public static Object payload(Entity entity, LightBodyDataVO vo) { + public static Object payload(int entity, LightBodyDataVO vo) { Object[] payload = new Object[2]; payload[0] = entity; payload[1] = vo; diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateLightDataCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateLightDataCommand.java index b9ca7b7b..7df21888 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateLightDataCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateLightDataCommand.java @@ -18,13 +18,13 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; import games.rednblack.editor.renderer.components.light.LightObjectComponent; import games.rednblack.editor.renderer.data.LightVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; public class UpdateLightDataCommand extends EntityModifyRevertibleCommand { @@ -35,14 +35,14 @@ public class UpdateLightDataCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; LightVO vo = (LightVO) payload[1]; entityId = EntityUtils.getEntityId(entity); backup = new LightVO(); - backup.loadFromEntity(entity); + backup.loadFromEntity(entity, sandbox.getEngine()); - LightObjectComponent lightObjectComponent = ComponentRetriever.get(entity, LightObjectComponent.class); + LightObjectComponent lightObjectComponent = SandboxComponentRetriever.get(entity, LightObjectComponent.class); lightObjectComponent.rays = vo.rays; lightObjectComponent.isStatic = vo.isStatic; @@ -61,8 +61,8 @@ public class UpdateLightDataCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); - LightObjectComponent lightObjectComponent = ComponentRetriever.get(entity, LightObjectComponent.class); + int entity = EntityUtils.getByUniqueId(entityId); + LightObjectComponent lightObjectComponent = SandboxComponentRetriever.get(entity, LightObjectComponent.class); lightObjectComponent.rays = backup.rays; lightObjectComponent.isStatic = backup.isStatic; @@ -79,7 +79,7 @@ public class UpdateLightDataCommand extends EntityModifyRevertibleCommand { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } - public static Object payload(Entity entity, LightVO vo) { + public static Object payload(int entity, LightVO vo) { Object[] payload = new Object[2]; payload[0] = entity; payload[1] = vo; diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateParticleDataCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateParticleDataCommand.java index d6ff5708..c3bb58dd 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateParticleDataCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateParticleDataCommand.java @@ -1,12 +1,12 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; import games.rednblack.editor.renderer.components.particle.ParticleComponent; import games.rednblack.editor.renderer.data.ParticleEffectVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; public class UpdateParticleDataCommand extends EntityModifyRevertibleCommand { @@ -17,14 +17,14 @@ public class UpdateParticleDataCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; ParticleEffectVO vo = (ParticleEffectVO) payload[1]; entityId = EntityUtils.getEntityId(entity); backup = new ParticleEffectVO(); - backup.loadFromEntity(entity); + backup.loadFromEntity(entity, sandbox.getEngine()); - ParticleComponent particleComponent = ComponentRetriever.get(entity, ParticleComponent.class); + ParticleComponent particleComponent = SandboxComponentRetriever.get(entity, ParticleComponent.class); particleComponent.transform = vo.transform; particleComponent.particleEffect.setPosition(0, 0); @@ -34,15 +34,15 @@ public class UpdateParticleDataCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); + int entity = EntityUtils.getByUniqueId(entityId); - ParticleComponent particleComponent = ComponentRetriever.get(entity, ParticleComponent.class); + ParticleComponent particleComponent = SandboxComponentRetriever.get(entity, ParticleComponent.class); particleComponent.transform = backup.transform; HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } - public static Object payload(Entity entity, ParticleEffectVO vo) { + public static Object payload(int entity, ParticleEffectVO vo) { Object[] payload = new Object[2]; payload[0] = entity; payload[1] = vo; diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/UpdatePhysicsDataCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/UpdatePhysicsDataCommand.java index 4a967f49..a854cb02 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/UpdatePhysicsDataCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/UpdatePhysicsDataCommand.java @@ -1,12 +1,12 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; import games.rednblack.editor.renderer.components.physics.PhysicsBodyComponent; import games.rednblack.editor.renderer.data.PhysicsBodyDataVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; public class UpdatePhysicsDataCommand extends EntityModifyRevertibleCommand { @@ -17,11 +17,11 @@ public class UpdatePhysicsDataCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; PhysicsBodyDataVO vo = (PhysicsBodyDataVO) payload[1]; entityId = EntityUtils.getEntityId(entity); - PhysicsBodyComponent physicsComponent = ComponentRetriever.get(entity, PhysicsBodyComponent.class); + PhysicsBodyComponent physicsComponent = SandboxComponentRetriever.get(entity, PhysicsBodyComponent.class); backup = new PhysicsBodyDataVO(); backup.loadFromComponent(physicsComponent); @@ -54,8 +54,8 @@ public class UpdatePhysicsDataCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); - PhysicsBodyComponent physicsComponent = ComponentRetriever.get(entity, PhysicsBodyComponent.class); + int entity = EntityUtils.getByUniqueId(entityId); + PhysicsBodyComponent physicsComponent = SandboxComponentRetriever.get(entity, PhysicsBodyComponent.class); physicsComponent.bodyType = backup.bodyType; physicsComponent.mass = backup.mass; @@ -83,7 +83,7 @@ public class UpdatePhysicsDataCommand extends EntityModifyRevertibleCommand { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } - public static Object payload(Entity entity, PhysicsBodyDataVO vo) { + public static Object payload(int entity, PhysicsBodyDataVO vo) { Object[] payload = new Object[2]; payload[0] = entity; payload[1] = vo; diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/UpdatePolygonDataCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/UpdatePolygonDataCommand.java index d4796c74..ea263240 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/UpdatePolygonDataCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/UpdatePolygonDataCommand.java @@ -18,8 +18,8 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; @@ -38,7 +38,7 @@ public class UpdatePolygonDataCommand extends EntityModifyRevertibleCommand { private void collectData() { Object[] payload = getNotification().getBody(); - entityId = EntityUtils.getEntityId((Entity) payload[0]); + entityId = EntityUtils.getEntityId((int) payload[0]); dataFrom = (Vector2[][]) payload[1]; dataTo = (Vector2[][]) payload[2]; dataFrom = dataFrom.clone(); @@ -49,9 +49,9 @@ public class UpdatePolygonDataCommand extends EntityModifyRevertibleCommand { public void doAction() { collectData(); - Entity entity = EntityUtils.getByUniqueId(entityId); + int entity = EntityUtils.getByUniqueId(entityId); - PolygonComponent polygonComponent = ComponentRetriever.get(entity, PolygonComponent.class); + PolygonComponent polygonComponent = SandboxComponentRetriever.get(entity, PolygonComponent.class); polygonComponent.vertices = dataTo; EntityUtils.refreshComponents(entity); @@ -62,9 +62,9 @@ public class UpdatePolygonDataCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); + int entity = EntityUtils.getByUniqueId(entityId); - PolygonComponent polygonComponent = ComponentRetriever.get(entity, PolygonComponent.class); + PolygonComponent polygonComponent = SandboxComponentRetriever.get(entity, PolygonComponent.class); polygonComponent.vertices = dataFrom; EntityUtils.refreshComponents(entity); @@ -72,8 +72,8 @@ public class UpdatePolygonDataCommand extends EntityModifyRevertibleCommand { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } - public static Object[] payloadInitialState(Entity entity) { - PolygonComponent polygonComponent = ComponentRetriever.get(entity, PolygonComponent.class); + public static Object[] payloadInitialState(int entity) { + PolygonComponent polygonComponent = SandboxComponentRetriever.get(entity, PolygonComponent.class); Object[] payload = new Object[3]; payload[0] = entity; payload[1] = cloneData(polygonComponent.vertices); diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateSensorDataCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateSensorDataCommand.java index 1d830f7b..1b93c476 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateSensorDataCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateSensorDataCommand.java @@ -1,13 +1,12 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; - import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; import games.rednblack.editor.renderer.components.physics.SensorComponent; import games.rednblack.editor.renderer.data.SensorDataVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; /** @@ -26,11 +25,11 @@ public class UpdateSensorDataCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; SensorDataVO vo = (SensorDataVO) payload[1]; entityId = EntityUtils.getEntityId(entity); - SensorComponent sensorComponent = ComponentRetriever.get(entity, SensorComponent.class); + SensorComponent sensorComponent = SandboxComponentRetriever.get(entity, SensorComponent.class); backup = new SensorDataVO(); backup.loadFromComponent(sensorComponent); @@ -52,8 +51,8 @@ public class UpdateSensorDataCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); - SensorComponent sensorComponent = ComponentRetriever.get(entity, SensorComponent.class); + int entity = EntityUtils.getByUniqueId(entityId); + SensorComponent sensorComponent = SandboxComponentRetriever.get(entity, SensorComponent.class); sensorComponent.bottom = backup.bottom; sensorComponent.left = backup.left; @@ -70,7 +69,7 @@ public class UpdateSensorDataCommand extends EntityModifyRevertibleCommand { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } - public static Object payload(Entity entity, SensorDataVO vo) { + public static Object payload(int entity, SensorDataVO vo) { Object[] payload = new Object[2]; payload[0] = entity; payload[1] = vo; diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateShaderDataCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateShaderDataCommand.java index ac48cc36..f1e4e20f 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateShaderDataCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateShaderDataCommand.java @@ -1,12 +1,12 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; import games.rednblack.editor.proxy.ResourceManager; import games.rednblack.editor.renderer.components.ShaderComponent; import games.rednblack.editor.renderer.data.MainItemVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; public class UpdateShaderDataCommand extends EntityModifyRevertibleCommand { @@ -18,12 +18,12 @@ public class UpdateShaderDataCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; String shaderName = (String) payload[1]; MainItemVO.RenderingLayer renderingLayer = (MainItemVO.RenderingLayer) payload[2]; entityId = EntityUtils.getEntityId(entity); - ShaderComponent shaderComponent = ComponentRetriever.get(entity, ShaderComponent.class); + ShaderComponent shaderComponent = SandboxComponentRetriever.get(entity, ShaderComponent.class); if (shaderComponent == null) { cancel(); return; @@ -45,8 +45,8 @@ public class UpdateShaderDataCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); - ShaderComponent shaderComponent = ComponentRetriever.get(entity, ShaderComponent.class); + int entity = EntityUtils.getByUniqueId(entityId); + ShaderComponent shaderComponent = SandboxComponentRetriever.get(entity, ShaderComponent.class); if (shaderComponent == null) return; ResourceManager resourceManager = facade.retrieveProxy(ResourceManager.NAME); @@ -61,7 +61,7 @@ public class UpdateShaderDataCommand extends EntityModifyRevertibleCommand { facade.sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } - public static Object payload(Entity entity, String shaderName, MainItemVO.RenderingLayer layer) { + public static Object payload(int entity, String shaderName, MainItemVO.RenderingLayer layer) { Object[] payload = new Object[3]; payload[0] = entity; payload[1] = shaderName; diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateSpineDataCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateSpineDataCommand.java index 76f8376b..342204f9 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateSpineDataCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateSpineDataCommand.java @@ -1,12 +1,12 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; import games.rednblack.editor.renderer.components.SpineDataComponent; import games.rednblack.editor.renderer.data.SpineVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.h2d.extention.spine.SpineObjectComponent; @@ -18,15 +18,15 @@ public class UpdateSpineDataCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; SpineVO vo = (SpineVO) payload[1]; entityId = EntityUtils.getEntityId(entity); backup = new SpineVO(); - backup.loadFromEntity(entity); + backup.loadFromEntity(entity, sandbox.getEngine()); - SpineDataComponent spineDataComponent = ComponentRetriever.get(entity, SpineDataComponent.class); - SpineObjectComponent spineObjectComponent = ComponentRetriever.get(entity, SpineObjectComponent.class); + SpineDataComponent spineDataComponent = SandboxComponentRetriever.get(entity, SpineDataComponent.class); + SpineObjectComponent spineObjectComponent = SandboxComponentRetriever.get(entity, SpineObjectComponent.class); spineDataComponent.currentAnimationName = vo.currentAnimationName; spineObjectComponent.setAnimation(vo.currentAnimationName); @@ -36,9 +36,9 @@ public class UpdateSpineDataCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); - SpineDataComponent spineDataComponent = ComponentRetriever.get(entity, SpineDataComponent.class); - SpineObjectComponent spineObjectComponent = ComponentRetriever.get(entity, SpineObjectComponent.class); + int entity = EntityUtils.getByUniqueId(entityId); + SpineDataComponent spineDataComponent = SandboxComponentRetriever.get(entity, SpineDataComponent.class); + SpineObjectComponent spineObjectComponent = SandboxComponentRetriever.get(entity, SpineObjectComponent.class); spineDataComponent.currentAnimationName = backup.currentAnimationName; spineObjectComponent.setAnimation(backup.currentAnimationName); @@ -46,7 +46,7 @@ public class UpdateSpineDataCommand extends EntityModifyRevertibleCommand { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } - public static Object payload(Entity entity, SpineVO vo) { + public static Object payload(int entity, SpineVO vo) { Object[] payload = new Object[2]; payload[0] = entity; payload[1] = vo; diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateSpriteAnimationDataCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateSpriteAnimationDataCommand.java index 80fd1974..724b1f60 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateSpriteAnimationDataCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateSpriteAnimationDataCommand.java @@ -1,6 +1,5 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.graphics.g2d.Animation; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; @@ -8,6 +7,7 @@ import games.rednblack.editor.renderer.components.sprite.SpriteAnimationComponen import games.rednblack.editor.renderer.components.sprite.SpriteAnimationStateComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; /** @@ -24,15 +24,15 @@ public class UpdateSpriteAnimationDataCommand extends EntityModifyRevertibleComm @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; entityId = EntityUtils.getEntityId(entity); int fps = (int) payload[1]; String animName = (String) payload[2]; Animation.PlayMode playMode = (Animation.PlayMode) payload[3]; - SpriteAnimationComponent spriteAnimationComponent = ComponentRetriever.get(entity, SpriteAnimationComponent.class); - SpriteAnimationStateComponent spriteAnimationStateComponent = ComponentRetriever.get(entity, SpriteAnimationStateComponent.class); + SpriteAnimationComponent spriteAnimationComponent = SandboxComponentRetriever.get(entity, SpriteAnimationComponent.class); + SpriteAnimationStateComponent spriteAnimationStateComponent = SandboxComponentRetriever.get(entity, SpriteAnimationStateComponent.class); previousFps = spriteAnimationComponent.fps; previousAnimationName = spriteAnimationComponent.currentAnimation; previousPlayMode = spriteAnimationComponent.playMode; @@ -47,10 +47,10 @@ public class UpdateSpriteAnimationDataCommand extends EntityModifyRevertibleComm @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); + int entity = EntityUtils.getByUniqueId(entityId); - SpriteAnimationComponent spriteAnimationComponent = ComponentRetriever.get(entity, SpriteAnimationComponent.class); - SpriteAnimationStateComponent spriteAnimationStateComponent = ComponentRetriever.get(entity, SpriteAnimationStateComponent.class); + SpriteAnimationComponent spriteAnimationComponent = SandboxComponentRetriever.get(entity, SpriteAnimationComponent.class); + SpriteAnimationStateComponent spriteAnimationStateComponent = SandboxComponentRetriever.get(entity, SpriteAnimationStateComponent.class); spriteAnimationComponent.fps = previousFps; spriteAnimationComponent.currentAnimation = previousAnimationName; spriteAnimationComponent.playMode = previousPlayMode; @@ -59,7 +59,7 @@ public class UpdateSpriteAnimationDataCommand extends EntityModifyRevertibleComm HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } - public static Object payload(Entity entity, int fps, String animName, Animation.PlayMode playMode) { + public static Object payload(int entity, int fps, String animName, Animation.PlayMode playMode) { Object[] payload = new Object[4]; payload[0] = entity; payload[1] = fps; diff --git a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateTalosDataCommand.java b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateTalosDataCommand.java index 2fe1d1f2..09e5cbeb 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/component/UpdateTalosDataCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/component/UpdateTalosDataCommand.java @@ -1,12 +1,12 @@ package games.rednblack.editor.controller.commands.component; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.EntityModifyRevertibleCommand; import games.rednblack.editor.renderer.components.particle.TalosDataComponent; import games.rednblack.editor.renderer.data.TalosVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.h2d.extension.talos.TalosComponent; @@ -18,17 +18,17 @@ public class UpdateTalosDataCommand extends EntityModifyRevertibleCommand { @Override public void doAction() { Object[] payload = getNotification().getBody(); - Entity entity = (Entity) payload[0]; + int entity = (int) payload[0]; TalosVO vo = (TalosVO) payload[1]; entityId = EntityUtils.getEntityId(entity); backup = new TalosVO(); - backup.loadFromEntity(entity); + backup.loadFromEntity(entity, sandbox.getEngine()); - TalosDataComponent dataComponent = ComponentRetriever.get(entity, TalosDataComponent.class); + TalosDataComponent dataComponent = SandboxComponentRetriever.get(entity, TalosDataComponent.class); dataComponent.transform = vo.transform; - TalosComponent talosComponent = ComponentRetriever.get(entity, TalosComponent.class); + TalosComponent talosComponent = SandboxComponentRetriever.get(entity, TalosComponent.class); talosComponent.effect.setPosition(0, 0); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); @@ -36,18 +36,18 @@ public class UpdateTalosDataCommand extends EntityModifyRevertibleCommand { @Override public void undoAction() { - Entity entity = EntityUtils.getByUniqueId(entityId); + int entity = EntityUtils.getByUniqueId(entityId); - TalosDataComponent particleComponent = ComponentRetriever.get(entity, TalosDataComponent.class); + TalosDataComponent particleComponent = SandboxComponentRetriever.get(entity, TalosDataComponent.class); particleComponent.transform = backup.transform; - TalosComponent talosComponent = ComponentRetriever.get(entity, TalosComponent.class); + TalosComponent talosComponent = SandboxComponentRetriever.get(entity, TalosComponent.class); talosComponent.effect.setPosition(0, 0); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } - public static Object payload(Entity entity, TalosVO vo) { + public static Object payload(int entity, TalosVO vo) { Object[] payload = new Object[2]; payload[0] = entity; payload[1] = vo; diff --git a/src/main/java/games/rednblack/editor/factory/ItemFactory.java b/src/main/java/games/rednblack/editor/factory/ItemFactory.java index 9022a5f2..d565c331 100644 --- a/src/main/java/games/rednblack/editor/factory/ItemFactory.java +++ b/src/main/java/games/rednblack/editor/factory/ItemFactory.java @@ -18,10 +18,9 @@ package games.rednblack.editor.factory; -import com.badlogic.ashley.core.Engine; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Vector2; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.PasteItemsCommand; @@ -48,7 +47,7 @@ public class ItemFactory implements IFactory { private final EntityFactory entityFactory; private final SceneLoader sceneLoader; private final Sandbox sandbox; - private Entity createdEntity; + private int createdEntity; private static ItemFactory instance; @@ -97,7 +96,7 @@ public class ItemFactory implements IFactory { } @Override - public Entity getCreatedEntity() { + public int getCreatedEntity() { return createdEntity; } @@ -144,7 +143,7 @@ public class ItemFactory implements IFactory { vo.originY = vo.shape.polygons[0][2].y / 2; if(!setEssentialData(vo, position)) return false; - Entity entity = entityFactory.createEntity(sandbox.getCurrentViewingEntity(), vo); + int entity = entityFactory.createEntity(sandbox.getCurrentViewingEntity(), vo); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ACTION_CREATE_ITEM, entity); @@ -161,10 +160,10 @@ public class ItemFactory implements IFactory { PasteItemsCommand.forceIdChange(itemVO.composite); createdEntity = createCompositeItem(itemVO, position); - if (createdEntity == null) return false; + if (createdEntity == -1) return false; //adding library name - MainItemComponent mainItemComponent = ComponentRetriever.get(createdEntity, MainItemComponent.class); + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(createdEntity, MainItemComponent.class); mainItemComponent.libraryLink = libraryName; HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ACTION_CREATE_ITEM, createdEntity); @@ -172,26 +171,24 @@ public class ItemFactory implements IFactory { return true; } - public Entity createCompositeItem(CompositeItemVO vo, Vector2 position) { - if(!setEssentialData(vo, position)) return null; + public int createCompositeItem(CompositeItemVO vo, Vector2 position) { + if(!setEssentialData(vo, position)) return -1; - Entity entity = entityFactory.createEntity(sandbox.getCurrentViewingEntity(), vo); - Engine engine = sceneLoader.getEngine(); + int entity = entityFactory.createEntity(sandbox.getCurrentViewingEntity(), vo); EntityFactory factory = sceneLoader.getEntityFactory(); - factory.initAllChildren(engine, entity, vo.composite); + factory.initAllChildren(entity, vo.composite); return entity; } - public Entity createCompositeItem(Vector2 position) { + public int createCompositeItem(Vector2 position) { CompositeItemVO vo = new CompositeItemVO(); - Entity entity = createCompositeItem(vo, position); - return entity; + return createCompositeItem(vo, position); } - public Entity createLightItem(LightVO vo, Vector2 position) { - if(!setEssentialData(vo, position)) return null; - Entity entity = entityFactory.createEntity(sandbox.getCurrentViewingEntity(), vo); + public int createLightItem(LightVO vo, Vector2 position) { + if(!setEssentialData(vo, position)) return -1; + int entity = entityFactory.createEntity(sandbox.getCurrentViewingEntity(), vo); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ACTION_CREATE_ITEM, entity); /* @@ -204,54 +201,50 @@ public class ItemFactory implements IFactory { } public boolean tryCreateParticleItem(String particleName, Vector2 position) { - Entity entity = createParticleItem(particleName, position); + int entity = createParticleItem(particleName, position); /* DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); float boundBoxSize = 10f; dimensionsComponent.boundBox = new Rectangle(-boundBoxSize / 2f, -boundBoxSize / 2f, boundBoxSize, boundBoxSize);*/ - if(entity == null) return false; - - return true; + return entity != -1; } - public Entity createParticleItem(String particleName, Vector2 position) { + public int createParticleItem(String particleName, Vector2 position) { ParticleEffectVO vo = new ParticleEffectVO(); vo.particleName = particleName; - if(!setEssentialData(vo, position)) return null; - Entity entity = entityFactory.createEntity(sandbox.getCurrentViewingEntity(), vo); + if(!setEssentialData(vo, position)) return -1; + int entity = entityFactory.createEntity(sandbox.getCurrentViewingEntity(), vo); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ACTION_CREATE_ITEM, entity); return entity; } public boolean tryCreateTalosItem(String particleName, Vector2 position) { - Entity entity = createTalosItem(particleName, position); + int entity = createTalosItem(particleName, position); /* DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); float boundBoxSize = 10f; dimensionsComponent.boundBox = new Rectangle(-boundBoxSize / 2f, -boundBoxSize / 2f, boundBoxSize, boundBoxSize);*/ - if(entity == null) return false; - - return true; + return entity != -1; } - public Entity createTalosItem(String particleName, Vector2 position) { + public int createTalosItem(String particleName, Vector2 position) { TalosVO vo = new TalosVO(); vo.particleName = particleName; - if(!setEssentialData(vo, position)) return null; - Entity entity = entityFactory.createEntity(sandbox.getCurrentViewingEntity(), vo); + if(!setEssentialData(vo, position)) return -1; + int entity = entityFactory.createEntity(sandbox.getCurrentViewingEntity(), vo); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ACTION_CREATE_ITEM, entity); return entity; } - public Entity createLabel(TextTool textSettings, Vector2 position) { + public int createLabel(TextTool textSettings, Vector2 position) { LabelVO vo = new LabelVO(); - if(!setEssentialData(vo, position)) return null; + if(!setEssentialData(vo, position)) return -1; HyperLap2DFacade facade = HyperLap2DFacade.getInstance(); ResourceManager resourceManager = facade.retrieveProxy(ResourceManager.NAME); @@ -267,7 +260,7 @@ public class ItemFactory implements IFactory { vo.width = 120f/Sandbox.getInstance().getPixelPerWU(); vo.height = 50f/Sandbox.getInstance().getPixelPerWU(); - Entity entity = entityFactory.createEntity(sandbox.getCurrentViewingEntity(), vo); + int entity = entityFactory.createEntity(sandbox.getCurrentViewingEntity(), vo); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ACTION_CREATE_ITEM, entity); return entity; diff --git a/src/main/java/games/rednblack/editor/graph/actions/ActionFieldType.java b/src/main/java/games/rednblack/editor/graph/actions/ActionFieldType.java index 05f889cc..78a4ca4f 100644 --- a/src/main/java/games/rednblack/editor/graph/actions/ActionFieldType.java +++ b/src/main/java/games/rednblack/editor/graph/actions/ActionFieldType.java @@ -20,7 +20,7 @@ public enum ActionFieldType implements FieldType { case Delay: return value instanceof DelayData; case Entity: - return value instanceof com.badlogic.ashley.core.Entity; + return value instanceof Integer; case Color: return value instanceof com.badlogic.gdx.graphics.Color; case Boolean: diff --git a/src/main/java/games/rednblack/editor/live/LivePreviewScreen.java b/src/main/java/games/rednblack/editor/live/LivePreviewScreen.java index 874c98e0..d10faf4e 100644 --- a/src/main/java/games/rednblack/editor/live/LivePreviewScreen.java +++ b/src/main/java/games/rednblack/editor/live/LivePreviewScreen.java @@ -15,6 +15,7 @@ import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.proxy.ProjectManager; import games.rednblack.editor.proxy.ResolutionManager; import games.rednblack.editor.proxy.ResourceManager; +import games.rednblack.editor.renderer.SceneConfiguration; import games.rednblack.editor.renderer.SceneLoader; import games.rednblack.editor.renderer.components.additional.ButtonComponent; import games.rednblack.editor.view.stage.Sandbox; @@ -51,9 +52,12 @@ public class LivePreviewScreen extends ScreenAdapter implements GestureDetector. viewport = new ExtendViewport(worldSizeVO.getWorldWidth(), worldSizeVO.getWorldHeight()); mCamera = (OrthographicCamera) viewport.getCamera(); - sceneLoader = new SceneLoader(resourceManager); - sceneLoader.injectExternalItemType(new SpineItemType()); - sceneLoader.injectExternalItemType(new TalosItemType()); + SceneConfiguration config = new SceneConfiguration(); + config.setResourceRetriever(resourceManager); + config.addExternalItemType(new SpineItemType()); + config.addExternalItemType(new TalosItemType()); + sceneLoader = new SceneLoader(config); + sceneLoader.loadScene(projectManager.getCurrentSceneConfigVO().sceneName, viewport); bgColor = projectManager.currentProjectVO.backgroundColor; @@ -74,7 +78,8 @@ public class LivePreviewScreen extends ScreenAdapter implements GestureDetector. mCamera.position.lerp(cameraTargetPos, 0.5f); viewport.apply(); - sceneLoader.getEngine().update(delta); + sceneLoader.getEngine().setDelta(delta); + sceneLoader.getEngine().process(); if (projectManager.currentProjectVO.box2dDebugRender) mBox2DDebugRenderer.render(sceneLoader.getWorld(), mCamera.combined); diff --git a/src/main/java/games/rednblack/editor/proxy/PluginManager.java b/src/main/java/games/rednblack/editor/proxy/PluginManager.java index 4210a176..9eb92bd2 100644 --- a/src/main/java/games/rednblack/editor/proxy/PluginManager.java +++ b/src/main/java/games/rednblack/editor/proxy/PluginManager.java @@ -18,12 +18,8 @@ package games.rednblack.editor.proxy; -import com.badlogic.ashley.core.Entity; -import com.badlogic.ashley.core.PooledEngine; -import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.utils.Array; import games.rednblack.editor.renderer.data.ProjectInfoVO; @@ -70,7 +66,7 @@ public class PluginManager extends Proxy implements PluginAPI { private ArrayList plugins = new ArrayList<>(); private String pluginDir, cacheDir; - private HashSet pluginEntities; + private HashSet pluginEntities; public PluginManager() { super(NAME); @@ -91,7 +87,7 @@ public class PluginManager extends Proxy implements PluginAPI { plugin.initPlugin(); } - public void dropDownActionSets(Set selectedEntities, Array actionsSet) { + public void dropDownActionSets(Set selectedEntities, Array actionsSet) { for(H2DPlugin plugin: plugins) { plugin.onDropDownOpen(selectedEntities, actionsSet); } @@ -138,7 +134,7 @@ public class PluginManager extends Proxy implements PluginAPI { } @Override - public void removeFollower(Entity entity) { + public void removeFollower(int entity) { FollowersUIMediator followersUIMediator = HyperLap2DFacade.getInstance().retrieveMediator(FollowersUIMediator.NAME); followersUIMediator.removeFollower(entity); } @@ -215,7 +211,7 @@ public class PluginManager extends Proxy implements PluginAPI { } @Override - public PooledEngine getEngine() { + public com.artemis.World getEngine() { return getSceneLoader().getEngine(); } @@ -229,13 +225,13 @@ public class PluginManager extends Proxy implements PluginAPI { return ItemFactory.get(); } - public boolean isEntityVisible(Entity e) { + public boolean isEntityVisible(int e) { LayerItemVO layer = EntityUtils.getEntityLayer(e); return layer != null && layer.isVisible; } @Override - public HashSet getProjectEntities() { + public HashSet getProjectEntities() { Sandbox sandbox = Sandbox.getInstance(); return sandbox.getSelector().getAllFreeItems(); } diff --git a/src/main/java/games/rednblack/editor/proxy/ProjectManager.java b/src/main/java/games/rednblack/editor/proxy/ProjectManager.java index b3590f82..4b8306c9 100755 --- a/src/main/java/games/rednblack/editor/proxy/ProjectManager.java +++ b/src/main/java/games/rednblack/editor/proxy/ProjectManager.java @@ -498,8 +498,9 @@ public class ProjectManager extends Proxy { try { HashMap fonts = fontManager.getFontsMap(); if (fonts.containsKey(font.fontName)) { - File source = new File(fonts.get(font.fontName)); - FileUtils.copyFileToDirectory(source, fontsDirectory.file()); + FileHandle source = new FileHandle(fonts.get(font.fontName)); + FileHandle dest = new FileHandle(fontsDirectory.path() + File.separator + font.fontName + ".ttf"); + FileUtils.copyFile(source.file(), dest.file()); } } catch (IOException e) { e.printStackTrace(); diff --git a/src/main/java/games/rednblack/editor/system/ParticleContinuousSystem.java b/src/main/java/games/rednblack/editor/system/ParticleContinuousSystem.java index ad3bcedf..6e381e36 100644 --- a/src/main/java/games/rednblack/editor/system/ParticleContinuousSystem.java +++ b/src/main/java/games/rednblack/editor/system/ParticleContinuousSystem.java @@ -1,6 +1,6 @@ package games.rednblack.editor.system; -import com.badlogic.ashley.core.Entity; +import com.artemis.annotations.All; import com.badlogic.gdx.graphics.g2d.ParticleEffect; import games.rednblack.editor.renderer.components.particle.ParticleComponent; import games.rednblack.editor.renderer.systems.ParticleSystem; @@ -10,11 +10,12 @@ import games.rednblack.editor.renderer.systems.ParticleSystem; * This system will make sure they look continuous while in editor, so user will find and see them easily. * */ +@All(ParticleComponent.class) public class ParticleContinuousSystem extends ParticleSystem { @Override - protected void processEntity(Entity entity, float deltaTime) { - super.processEntity(entity, deltaTime); + protected void process(int entity) { + super.process(entity); ParticleComponent particleComponent = particleComponentMapper.get(entity); ParticleEffect particleEffect = particleComponent.particleEffect; diff --git a/src/main/java/games/rednblack/editor/system/PhysicsAdjustSystem.java b/src/main/java/games/rednblack/editor/system/PhysicsAdjustSystem.java index 16ca77af..48fdfca9 100644 --- a/src/main/java/games/rednblack/editor/system/PhysicsAdjustSystem.java +++ b/src/main/java/games/rednblack/editor/system/PhysicsAdjustSystem.java @@ -1,29 +1,28 @@ package games.rednblack.editor.system; -import com.badlogic.ashley.core.Entity; +import com.artemis.annotations.All; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.physics.box2d.World; import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.components.physics.PhysicsBodyComponent; import games.rednblack.editor.renderer.systems.PhysicsSystem; -import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; +@All(PhysicsBodyComponent.class) public class PhysicsAdjustSystem extends PhysicsSystem { private final Vector2 transformVec = new Vector2(); - public PhysicsAdjustSystem(World world) { - super(world); + public PhysicsAdjustSystem() { setPhysicsOn(false); } @Override - protected void processEntity(Entity entity, float deltaTime) { + protected void process(int entity) { TransformComponent transformComponent = transformComponentMapper.get(entity); processBody(entity); - PhysicsBodyComponent physicsBodyComponent = ComponentRetriever.get(entity, PhysicsBodyComponent.class); + PhysicsBodyComponent physicsBodyComponent = SandboxComponentRetriever.get(entity, PhysicsBodyComponent.class); if(physicsBodyComponent.body == null) return; diff --git a/src/main/java/games/rednblack/editor/system/TalosContinuousSystem.java b/src/main/java/games/rednblack/editor/system/TalosContinuousSystem.java index 9fb608b3..d262d528 100644 --- a/src/main/java/games/rednblack/editor/system/TalosContinuousSystem.java +++ b/src/main/java/games/rednblack/editor/system/TalosContinuousSystem.java @@ -1,7 +1,8 @@ package games.rednblack.editor.system; -import com.badlogic.ashley.core.Entity; +import com.artemis.annotations.All; import com.talosvfx.talos.runtime.ParticleEffectInstance; +import games.rednblack.editor.renderer.components.particle.TalosDataComponent; import games.rednblack.h2d.extension.talos.TalosComponent; import games.rednblack.h2d.extension.talos.TalosSystem; @@ -10,11 +11,12 @@ import games.rednblack.h2d.extension.talos.TalosSystem; * This system will make sure they look continuous while in editor, so user will find and see them easily. * */ +@All({TalosComponent.class, TalosDataComponent.class}) public class TalosContinuousSystem extends TalosSystem { @Override - protected void processEntity(Entity entity, float deltaTime) { - super.processEntity(entity, deltaTime); + protected void process(int entity) { + super.process(entity); TalosComponent talosComponent = particleComponentMapper.get(entity); ParticleEffectInstance effect = talosComponent.effect; diff --git a/src/main/java/games/rednblack/editor/utils/AssetImporter.java b/src/main/java/games/rednblack/editor/utils/AssetImporter.java index afa5327e..0647d07d 100644 --- a/src/main/java/games/rednblack/editor/utils/AssetImporter.java +++ b/src/main/java/games/rednblack/editor/utils/AssetImporter.java @@ -1,6 +1,5 @@ package games.rednblack.editor.utils; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.Array; import com.kotcrab.vis.ui.util.dialog.Dialogs; @@ -123,14 +122,14 @@ public class AssetImporter { return null; } - public boolean deleteAsset(int type, Entity root, String name) { + public boolean deleteAsset(int type, int root, String name) { Asset asset = getDescriptorFor(type); if (asset != null) return asset.deleteAsset(root, name); return false; } - public boolean deleteAsset(Entity root, String name) { + public boolean deleteAsset(int root, String name) { for (Asset asset : new Array.ArrayIterator<>(assetDescriptors)) { if (asset.deleteAsset(root, name)) return true; diff --git a/src/main/java/games/rednblack/editor/utils/EntityBounds.java b/src/main/java/games/rednblack/editor/utils/EntityBounds.java index 4833bcfc..acf89ea7 100644 --- a/src/main/java/games/rednblack/editor/utils/EntityBounds.java +++ b/src/main/java/games/rednblack/editor/utils/EntityBounds.java @@ -18,7 +18,6 @@ package games.rednblack.editor.utils; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Matrix3; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector2; @@ -27,7 +26,7 @@ import games.rednblack.editor.renderer.components.DimensionsComponent; import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.components.light.LightObjectComponent; import games.rednblack.editor.renderer.components.particle.ParticleComponent; -import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.extension.talos.TalosComponent; /** @@ -54,7 +53,7 @@ public class EntityBounds extends Rectangle { private final Array boundPointList = new Array<>(); private final float[] boundPoints = new float[8]; - public EntityBounds(Entity entity) { + public EntityBounds(int entity) { setEntity(entity); } @@ -62,9 +61,9 @@ public class EntityBounds extends Rectangle { } - public void setEntity(Entity entity) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + public void setEntity(int entity) { + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); x = transformComponent.x; y = transformComponent.y; scaleX = transformComponent.scaleX * (transformComponent.flipX ? -1 : 1); @@ -72,7 +71,7 @@ public class EntityBounds extends Rectangle { width = dimensionsComponent.width; height = dimensionsComponent.height; - if (ComponentRetriever.get(entity, LightObjectComponent.class) != null) { + if (SandboxComponentRetriever.get(entity, LightObjectComponent.class) != null) { x += dimensionsComponent.boundBox.x; y += dimensionsComponent.boundBox.y; scaleX = 1; @@ -81,8 +80,8 @@ public class EntityBounds extends Rectangle { height = dimensionsComponent.boundBox.height; } - if (ComponentRetriever.get(entity, ParticleComponent.class) != null - || ComponentRetriever.get(entity, TalosComponent.class) != null) { + if (SandboxComponentRetriever.get(entity, ParticleComponent.class) != null + || SandboxComponentRetriever.get(entity, TalosComponent.class) != null) { width = dimensionsComponent.boundBox.width; height = dimensionsComponent.boundBox.height; dimensionsComponent.width = width; @@ -186,7 +185,7 @@ public class EntityBounds extends Rectangle { return boundPoints; } - public float[] getBoundPoints(Entity entity) { + public float[] getBoundPoints(int entity) { setEntity(entity); return boundPoints; } @@ -197,7 +196,7 @@ public class EntityBounds extends Rectangle { return boundPointList; } - public Array getBoundPointsList(Entity entity) { + public Array getBoundPointsList(int entity) { setEntity(entity); return getBoundPointsList(); diff --git a/src/main/java/games/rednblack/editor/utils/MoveCommandBuilder.java b/src/main/java/games/rednblack/editor/utils/MoveCommandBuilder.java index d2492d79..80cafe9f 100644 --- a/src/main/java/games/rednblack/editor/utils/MoveCommandBuilder.java +++ b/src/main/java/games/rednblack/editor/utils/MoveCommandBuilder.java @@ -18,9 +18,9 @@ package games.rednblack.editor.utils; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; +import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.renderer.components.TransformComponent; @@ -37,17 +37,17 @@ public class MoveCommandBuilder { payload = new Array<>(); } - public void setX(Entity entity, float x) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + public void setX(int entity, float x) { + TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class, Sandbox.getInstance().getEngine()); setXY(entity, x, transformComponent.y); } - public void setY(Entity entity, float y) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + public void setY(int entity, float y) { + TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class, Sandbox.getInstance().getEngine()); setXY(entity, transformComponent.x, y); } - public void setXY(Entity entity, float x, float y) { + public void setXY(int entity, float x, float y) { Object[] data = new Object[2]; data[0] = entity; data[1] = new Vector2(x, y); diff --git a/src/main/java/games/rednblack/editor/utils/asset/Asset.java b/src/main/java/games/rednblack/editor/utils/asset/Asset.java index 0e472af5..25cd8885 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/Asset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/Asset.java @@ -1,6 +1,5 @@ package games.rednblack.editor.utils.asset; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.Array; import games.rednblack.editor.HyperLap2DFacade; @@ -25,7 +24,7 @@ public abstract class Asset implements IAsset { protected ResolutionManager resolutionManager; protected ResourceManager resourceManager; - protected final ArrayList tmpEntityList = new ArrayList<>(); + protected final ArrayList tmpEntityList = new ArrayList<>(); protected final ArrayList tmpImageList = new ArrayList<>(); public Asset() { diff --git a/src/main/java/games/rednblack/editor/utils/asset/IAsset.java b/src/main/java/games/rednblack/editor/utils/asset/IAsset.java index 25a3fd4f..2af4906c 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/IAsset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/IAsset.java @@ -1,6 +1,5 @@ package games.rednblack.editor.utils.asset; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.Array; import games.rednblack.h2d.common.ProgressHandler; @@ -9,5 +8,5 @@ public interface IAsset { int matchType(Array files); boolean checkExistence(Array files); void importAsset(Array files, ProgressHandler progressHandler, boolean skipRepack); - boolean deleteAsset(Entity root, String name); + boolean deleteAsset(int root, String name); } diff --git a/src/main/java/games/rednblack/editor/utils/asset/impl/AtlasAsset.java b/src/main/java/games/rednblack/editor/utils/asset/impl/AtlasAsset.java index 8aa3d434..44b49bc1 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/impl/AtlasAsset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/impl/AtlasAsset.java @@ -1,6 +1,5 @@ package games.rednblack.editor.utils.asset.impl; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.utils.Array; @@ -74,7 +73,7 @@ public class AtlasAsset extends Asset { } @Override - public boolean deleteAsset(Entity root, String name) { + public boolean deleteAsset(int root, String name) { return false; } } diff --git a/src/main/java/games/rednblack/editor/utils/asset/impl/HyperLap2DActionAsset.java b/src/main/java/games/rednblack/editor/utils/asset/impl/HyperLap2DActionAsset.java index 8295a7ef..6543373d 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/impl/HyperLap2DActionAsset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/impl/HyperLap2DActionAsset.java @@ -1,6 +1,5 @@ package games.rednblack.editor.utils.asset.impl; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Json; @@ -45,7 +44,7 @@ public class HyperLap2DActionAsset extends Asset { } @Override - public boolean deleteAsset(Entity root, String name) { + public boolean deleteAsset(int root, String name) { HashMap libraryActions = projectManager.currentProjectInfoVO.libraryActions; libraryActions.remove(name); diff --git a/src/main/java/games/rednblack/editor/utils/asset/impl/HyperLap2DInternalLibraryAsset.java b/src/main/java/games/rednblack/editor/utils/asset/impl/HyperLap2DInternalLibraryAsset.java index c80b3302..e2cdb722 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/impl/HyperLap2DInternalLibraryAsset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/impl/HyperLap2DInternalLibraryAsset.java @@ -1,6 +1,5 @@ package games.rednblack.editor.utils.asset.impl; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Json; @@ -53,7 +52,7 @@ public class HyperLap2DInternalLibraryAsset extends Asset { } @Override - public boolean deleteAsset(Entity root, String name) { + public boolean deleteAsset(int root, String name) { return false; } diff --git a/src/main/java/games/rednblack/editor/utils/asset/impl/HyperLap2DLibraryAsset.java b/src/main/java/games/rednblack/editor/utils/asset/impl/HyperLap2DLibraryAsset.java index 22696ca8..3141459a 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/impl/HyperLap2DLibraryAsset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/impl/HyperLap2DLibraryAsset.java @@ -1,6 +1,5 @@ package games.rednblack.editor.utils.asset.impl; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.GdxRuntimeException; @@ -16,6 +15,7 @@ import games.rednblack.editor.utils.ImportUtils; import games.rednblack.editor.utils.ZipUtils; import games.rednblack.editor.utils.asset.Asset; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.h2d.common.ProgressHandler; import games.rednblack.h2d.common.vo.ExportMapperVO; @@ -134,14 +134,14 @@ public class HyperLap2DLibraryAsset extends Asset { } @Override - public boolean deleteAsset(Entity root, String name) { + public boolean deleteAsset(int root, String name) { HashMap libraryItems = projectManager.currentProjectInfoVO.libraryItems; libraryItems.remove(name); - Array linkedEntities = EntityUtils.getByLibraryLink(name); - for (Entity entity : linkedEntities) { - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + Array linkedEntities = EntityUtils.getByLibraryLink(name); + for (int entity : linkedEntities) { + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(entity, MainItemComponent.class); mainItemComponent.libraryLink = ""; } diff --git a/src/main/java/games/rednblack/editor/utils/asset/impl/ImageAsset.java b/src/main/java/games/rednblack/editor/utils/asset/impl/ImageAsset.java index 05c5bca0..19d6175e 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/impl/ImageAsset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/impl/ImageAsset.java @@ -1,6 +1,5 @@ package games.rednblack.editor.utils.asset.impl; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.Array; import games.rednblack.editor.proxy.ProjectManager; @@ -15,6 +14,8 @@ import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.ImportUtils; import games.rednblack.editor.utils.asset.Asset; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; +import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.h2d.common.ProgressHandler; import java.io.File; @@ -70,7 +71,7 @@ public class ImageAsset extends Asset { } @Override - public boolean deleteAsset(Entity root, String name) { + public boolean deleteAsset(int root, String name) { for (ResolutionEntryVO resolutionEntryVO : projectManager.getCurrentProjectInfoVO().resolutions) { if(!deleteSingleImage(resolutionEntryVO.name, name)) return false; @@ -99,7 +100,7 @@ public class ImageAsset extends Asset { * Clear scenes and library items that contains deleted image * @param imageName image to delete */ - protected void postDeleteImage(Entity root, String imageName) { + protected void postDeleteImage(int root, String imageName) { deleteEntitiesWithImages(root, imageName); deleteAllItemsImages(imageName); } @@ -137,15 +138,15 @@ public class ImageAsset extends Asset { } } - private void deleteEntitiesWithImages(Entity rootEntity, String regionName) { + private void deleteEntitiesWithImages(int rootEntity, String regionName) { tmpEntityList.clear(); - Consumer action = (root) -> { - TextureRegionComponent regionComponent = ComponentRetriever.get(root, TextureRegionComponent.class); + Consumer action = (root) -> { + TextureRegionComponent regionComponent = SandboxComponentRetriever.get(root, TextureRegionComponent.class); if (regionComponent != null && regionComponent.regionName.equals(regionName)) { tmpEntityList.add(root); } - NinePatchComponent ninePatchComponent = ComponentRetriever.get(root, NinePatchComponent.class); + NinePatchComponent ninePatchComponent = SandboxComponentRetriever.get(root, NinePatchComponent.class); if (ninePatchComponent != null && ninePatchComponent.textureRegionName.equals(regionName)) { tmpEntityList.add(root); } diff --git a/src/main/java/games/rednblack/editor/utils/asset/impl/ParticleEffectAsset.java b/src/main/java/games/rednblack/editor/utils/asset/impl/ParticleEffectAsset.java index b94b15d1..a410d259 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/impl/ParticleEffectAsset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/impl/ParticleEffectAsset.java @@ -1,6 +1,5 @@ package games.rednblack.editor.utils.asset.impl; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.Array; import com.kotcrab.vis.ui.util.dialog.Dialogs; @@ -13,6 +12,7 @@ import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.ImportUtils; import games.rednblack.editor.utils.asset.Asset; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.h2d.common.ProgressHandler; import org.apache.commons.io.FileUtils; @@ -95,7 +95,7 @@ public class ParticleEffectAsset extends Asset { } @Override - public boolean deleteAsset(Entity root, String name) { + public boolean deleteAsset(int root, String name) { String particlePath = projectManager.getCurrentProjectPath() + File.separator + ProjectManager.PARTICLE_DIR_PATH + File.separator; String filePath = particlePath + name; @@ -175,10 +175,10 @@ public class ParticleEffectAsset extends Asset { } } - private void deleteEntitiesWithParticleEffects(Entity rootEntity, String particleName) { + private void deleteEntitiesWithParticleEffects(int rootEntity, String particleName) { tmpEntityList.clear(); - Consumer action = (root) -> { - ParticleComponent particleComponent = ComponentRetriever.get(root, ParticleComponent.class); + Consumer action = (root) -> { + ParticleComponent particleComponent = SandboxComponentRetriever.get(root, ParticleComponent.class); if (particleComponent != null && particleComponent.particleName.equals(particleName)) { tmpEntityList.add(root); } diff --git a/src/main/java/games/rednblack/editor/utils/asset/impl/ShaderAsset.java b/src/main/java/games/rednblack/editor/utils/asset/impl/ShaderAsset.java index 9f522833..e652f8e5 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/impl/ShaderAsset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/impl/ShaderAsset.java @@ -1,6 +1,5 @@ package games.rednblack.editor.utils.asset.impl; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.Array; import games.rednblack.editor.proxy.ProjectManager; @@ -53,7 +52,7 @@ public class ShaderAsset extends Asset { } @Override - public boolean deleteAsset(Entity root, String name) { + public boolean deleteAsset(int root, String name) { return false; } } diff --git a/src/main/java/games/rednblack/editor/utils/asset/impl/SpineAsset.java b/src/main/java/games/rednblack/editor/utils/asset/impl/SpineAsset.java index 6ee7a2ec..bf8ccc36 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/impl/SpineAsset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/impl/SpineAsset.java @@ -1,6 +1,5 @@ package games.rednblack.editor.utils.asset.impl; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.utils.Array; @@ -18,6 +17,7 @@ import games.rednblack.editor.utils.HyperLap2DUtils; import games.rednblack.editor.utils.ImportUtils; import games.rednblack.editor.utils.asset.Asset; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.h2d.common.ProgressHandler; import games.rednblack.h2d.extention.spine.SpineItemType; @@ -77,7 +77,7 @@ public class SpineAsset extends Asset { } @Override - public boolean deleteAsset(Entity root, String spineName) { + public boolean deleteAsset(int root, String spineName) { for (ResolutionEntryVO resolutionEntryVO : projectManager.getCurrentProjectInfoVO().resolutions) { if(!deleteSpineAnimation(resolutionEntryVO.name, spineName)) return false; @@ -205,7 +205,7 @@ public class SpineAsset extends Asset { return true; } - protected void postDeleteSpineAnimation(Entity root, String spineAnimationName) { + protected void postDeleteSpineAnimation(int root, String spineAnimationName) { deleteEntitiesWithSpineAnimation(root, spineAnimationName); deleteAllItemsSpineAnimations(spineAnimationName); } @@ -233,10 +233,10 @@ public class SpineAsset extends Asset { } } - private void deleteEntitiesWithSpineAnimation(Entity rootEntity, String spineName) { + private void deleteEntitiesWithSpineAnimation(int rootEntity, String spineName) { tmpEntityList.clear(); - Consumer action = (root) -> { - SpineDataComponent spineDataComponent = ComponentRetriever.get(root, SpineDataComponent.class); + Consumer action = (root) -> { + SpineDataComponent spineDataComponent = SandboxComponentRetriever.get(root, SpineDataComponent.class); if (spineDataComponent != null && spineDataComponent.animationName.equals(spineName)) { tmpEntityList.add(root); } diff --git a/src/main/java/games/rednblack/editor/utils/asset/impl/SpriteAnimationAtlasAsset.java b/src/main/java/games/rednblack/editor/utils/asset/impl/SpriteAnimationAtlasAsset.java index fa5c1a26..b549c397 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/impl/SpriteAnimationAtlasAsset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/impl/SpriteAnimationAtlasAsset.java @@ -1,6 +1,5 @@ package games.rednblack.editor.utils.asset.impl; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.badlogic.gdx.utils.Array; @@ -13,6 +12,8 @@ import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.ImportUtils; import games.rednblack.editor.utils.asset.Asset; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; +import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.h2d.common.ProgressHandler; import org.apache.commons.io.FileUtils; @@ -101,7 +102,7 @@ public class SpriteAnimationAtlasAsset extends Asset { } @Override - public boolean deleteAsset(Entity root, String name) { + public boolean deleteAsset(int root, String name) { for (ResolutionEntryVO resolutionEntryVO : projectManager.getCurrentProjectInfoVO().resolutions) { if(!deleteSpriteAnimation(resolutionEntryVO.name, name)) return false; @@ -128,7 +129,7 @@ public class SpriteAnimationAtlasAsset extends Asset { return ImportUtils.deleteDirectory(filePath); } - protected void postDeleteSpriteAnimation(Entity root, String spriteAnimationName) { + protected void postDeleteSpriteAnimation(int root, String spriteAnimationName) { deleteEntitiesWithSpriteAnimation(root, spriteAnimationName); deleteAllItemsSpriteAnimations(spriteAnimationName); } @@ -158,10 +159,10 @@ public class SpriteAnimationAtlasAsset extends Asset { } } - private void deleteEntitiesWithSpriteAnimation(Entity rootEntity, String spriteAnimationName) { + private void deleteEntitiesWithSpriteAnimation(int rootEntity, String spriteAnimationName) { tmpEntityList.clear(); - Consumer action = (root) -> { - SpriteAnimationComponent spriteAnimationComponent = ComponentRetriever.get(root, SpriteAnimationComponent.class); + Consumer action = (root) -> { + SpriteAnimationComponent spriteAnimationComponent = SandboxComponentRetriever.get(root, SpriteAnimationComponent.class); if (spriteAnimationComponent != null && spriteAnimationComponent.animationName.equals(spriteAnimationName)) { tmpEntityList.add(root); } diff --git a/src/main/java/games/rednblack/editor/utils/asset/impl/TalosVFXAsset.java b/src/main/java/games/rednblack/editor/utils/asset/impl/TalosVFXAsset.java index 6e3ea3c2..de7ec46d 100644 --- a/src/main/java/games/rednblack/editor/utils/asset/impl/TalosVFXAsset.java +++ b/src/main/java/games/rednblack/editor/utils/asset/impl/TalosVFXAsset.java @@ -1,6 +1,5 @@ package games.rednblack.editor.utils.asset.impl; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Json; @@ -15,6 +14,7 @@ import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.ImportUtils; import games.rednblack.editor.utils.asset.Asset; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.utils.runtime.TalosResources; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.h2d.common.ProgressHandler; @@ -115,7 +115,7 @@ public class TalosVFXAsset extends Asset { } @Override - public boolean deleteAsset(Entity root, String name) { + public boolean deleteAsset(int root, String name) { String particlePath = projectManager.getCurrentProjectPath() + File.separator + ProjectManager.TALOS_VFX_DIR_PATH + File.separator; String filePath = particlePath + name; @@ -217,10 +217,10 @@ public class TalosVFXAsset extends Asset { } } - private void deleteEntitiesWithParticleEffects(Entity rootEntity, String particleName) { + private void deleteEntitiesWithParticleEffects(int rootEntity, String particleName) { tmpEntityList.clear(); - Consumer action = (root) -> { - TalosDataComponent particleComponent = ComponentRetriever.get(root, TalosDataComponent.class); + Consumer action = (root) -> { + TalosDataComponent particleComponent = SandboxComponentRetriever.get(root, TalosDataComponent.class); if (particleComponent != null && particleComponent.particleName.equals(particleName)) { tmpEntityList.add(root); } diff --git a/src/main/java/games/rednblack/editor/utils/runtime/ComponentCloner.java b/src/main/java/games/rednblack/editor/utils/runtime/ComponentCloner.java index a59928ee..587bc665 100644 --- a/src/main/java/games/rednblack/editor/utils/runtime/ComponentCloner.java +++ b/src/main/java/games/rednblack/editor/utils/runtime/ComponentCloner.java @@ -23,7 +23,7 @@ import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collection; -import com.badlogic.ashley.core.Component; +import com.artemis.Component; import com.badlogic.gdx.utils.reflect.ClassReflection; import com.badlogic.gdx.utils.reflect.ReflectionException; diff --git a/src/main/java/games/rednblack/editor/utils/runtime/EntityUtils.java b/src/main/java/games/rednblack/editor/utils/runtime/EntityUtils.java index a96ab095..5517d0e3 100644 --- a/src/main/java/games/rednblack/editor/utils/runtime/EntityUtils.java +++ b/src/main/java/games/rednblack/editor/utils/runtime/EntityUtils.java @@ -18,11 +18,10 @@ package games.rednblack.editor.utils.runtime; -import com.badlogic.ashley.core.Component; -import com.badlogic.ashley.core.Entity; -import com.badlogic.ashley.core.Family; -import com.badlogic.ashley.core.PooledEngine; -import com.badlogic.ashley.utils.ImmutableArray; +import com.artemis.Aspect; +import com.artemis.Component; +import com.artemis.EntitySubscription; +import com.artemis.utils.IntBag; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.utils.Drawable; import com.badlogic.gdx.utils.Array; @@ -75,12 +74,12 @@ public class EntityUtils { itemTypeIconMap.put(TALOS_TYPE, "icon-particle-white"); } - public static String getItemName(Entity entity) { - ParentNodeComponent parentNodeComponent = ComponentRetriever.get(entity, ParentNodeComponent.class); + public static String getItemName(int entity) { + ParentNodeComponent parentNodeComponent = SandboxComponentRetriever.get(entity, ParentNodeComponent.class); if (parentNodeComponent == null) return Sandbox.getInstance().sceneControl.getCurrentSceneVO().sceneName; - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(entity, MainItemComponent.class); if (mainItemComponent.itemIdentifier != null && !mainItemComponent.itemIdentifier.isEmpty()) { return mainItemComponent.itemIdentifier; } else { @@ -93,21 +92,21 @@ public class EntityUtils { } } - public static Drawable getItemIcon(Entity entity) { + public static Drawable getItemIcon(int entity) { int type = EntityUtils.getType(entity); String icon = itemTypeIconMap.get(type); return VisUI.getSkin().getDrawable(icon); } - public static Integer getEntityId(Entity entity) { - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + public static Integer getEntityId(int entity) { + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(entity, MainItemComponent.class); return mainItemComponent.uniqueId; } - public static Array getEntityId(Iterable entities) { + public static Array getEntityId(Iterable entities) { Array entityIds = new Array<>(); - for (Entity entity : entities) { - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + for (int entity : entities) { + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(entity, MainItemComponent.class); if (mainItemComponent != null) entityIds.add(mainItemComponent.uniqueId); } @@ -115,23 +114,23 @@ public class EntityUtils { return entityIds; } - public static Entity getByUniqueId(Integer id) { + public static int getByUniqueId(Integer id) { return Sandbox.getInstance().getSceneControl().sceneLoader.getEntityFactory().getEntityByUniqueId(id); } - public static HashSet getByUniqueId(Array ids) { - HashSet entities = new HashSet<>(); + public static HashSet getByUniqueId(Array ids) { + HashSet entities = new HashSet<>(); for (Integer id : ids) { - Entity entity = Sandbox.getInstance().getSceneControl().sceneLoader.getEntityFactory().getEntityByUniqueId(id); + Integer entity = Sandbox.getInstance().getSceneControl().sceneLoader.getEntityFactory().getEntityByUniqueId(id); entities.add(entity); } return entities; } - public static HashMap> cloneEntities(Set entities) { + /*public static HashMap> cloneEntities(Set entities) { HashMap> data = new HashMap<>(); - for (Entity entity : entities) { + for (int entity : entities) { Collection components = cloneEntityComponents(entity); data.put(EntityUtils.getEntityId(entity), components); } @@ -139,51 +138,51 @@ public class EntityUtils { return data; } - public static Entity cloneEntity(PooledEngine engine, Entity entity) { - Entity newEntity = engine.createEntity(); + public static int cloneEntity(com.artemis.World engine, int entity) { + int newEntity = engine.create(); Collection components = cloneEntityComponents(entity); for (Component component : components) { - Component c = engine.createComponent(component.getClass()); + Component c = engine.edit(newEntity).create(component.getClass()); ComponentCloner.set(c, component); - newEntity.add(component); } return newEntity; } - public static Collection cloneEntityComponents(Entity entity) { - Collection components = ComponentCloner.cloneAll(ComponentRetriever.getComponents(entity)); + public static Collection cloneEntityComponents(int entity) { + Array array = new Array<>(); + Collection components = ComponentCloner.cloneAll(ComponentRetriever.getComponents(entity, array)); return components; - } + }*/ - public static Vector2 getPosition(Entity entity) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + public static Vector2 getPosition(int entity) { + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); return new Vector2(transformComponent.x, transformComponent.y); } - public static void getPosition(Entity entity, Vector2 position) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + public static void getPosition(int entity, Vector2 position) { + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); position.set(transformComponent.x, transformComponent.y); } - public static TransformComponent setPosition(Entity entity, Vector2 position) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + public static TransformComponent setPosition(int entity, Vector2 position) { + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); transformComponent.x = position.x; transformComponent.y = position.y; return transformComponent; } - public static Vector2 getSize(Entity entity) { - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + public static Vector2 getSize(int entity) { + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); return new Vector2(dimensionsComponent.width, dimensionsComponent.height); } - public static void getSize(Entity entity, Vector2 size) { - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + public static void getSize(int entity, Vector2 size) { + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); size.set(dimensionsComponent.width, dimensionsComponent.height); } - public static DimensionsComponent setSize(Entity entity, Vector2 size) { - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + public static DimensionsComponent setSize(int entity, Vector2 size) { + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); dimensionsComponent.width = size.x; dimensionsComponent.height = size.y; if (dimensionsComponent.boundBox != null) { @@ -193,14 +192,14 @@ public class EntityUtils { return dimensionsComponent; } - public static Vector2 getRightTopPoint(Set entities) { + public static Vector2 getRightTopPoint(Set entities) { if (entities.size() == 0) return null; Vector2 rightTopPoint = getPosition(entities.stream().findFirst().get()); - for (Entity entity : entities) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + for (int entity : entities) { + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); if (rightTopPoint.x < transformComponent.x + dimensionsComponent.width) { rightTopPoint.x = transformComponent.x + dimensionsComponent.width; @@ -213,13 +212,13 @@ public class EntityUtils { return rightTopPoint; } - public static Vector2 getLeftBottomPoint(Set entities) { + public static Vector2 getLeftBottomPoint(Set entities) { if (entities.size() == 0) return null; Vector2 leftBottomPoint = getPosition(entities.stream().findFirst().get()); - for (Entity entity : entities) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + for (int entity : entities) { + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); if (leftBottomPoint.x > transformComponent.x) { leftBottomPoint.x = transformComponent.x; } @@ -231,16 +230,16 @@ public class EntityUtils { return leftBottomPoint; } - public static void changeParent(HashSet entities, Entity parent) { - for (Entity entity : entities) { - ParentNodeComponent parentNodeComponent = ComponentRetriever.get(entity, ParentNodeComponent.class); + public static void changeParent(HashSet entities, int parent) { + for (int entity : entities) { + ParentNodeComponent parentNodeComponent = SandboxComponentRetriever.get(entity, ParentNodeComponent.class); //remove me from previous parent children list - NodeComponent nodeComponent = ComponentRetriever.get(parentNodeComponent.parentEntity, NodeComponent.class); + NodeComponent nodeComponent = SandboxComponentRetriever.get(parentNodeComponent.parentEntity, NodeComponent.class); nodeComponent.children.removeValue(entity, true); //add me to new parent child list - NodeComponent rootNodeComponent = ComponentRetriever.get(parent, NodeComponent.class); + NodeComponent rootNodeComponent = SandboxComponentRetriever.get(parent, NodeComponent.class); rootNodeComponent.children.add(entity); //change my parent @@ -248,29 +247,31 @@ public class EntityUtils { } } - public static HashSet getChildren(Entity entity) { - HashSet entities; - NodeComponent nodeComponent = ComponentRetriever.get(entity, NodeComponent.class); + public static HashSet getChildren(int entity) { + HashSet entities; + NodeComponent nodeComponent = SandboxComponentRetriever.get(entity, NodeComponent.class); if (nodeComponent == null) return null; - Entity[] children = nodeComponent.children.toArray(); + Integer[] children = nodeComponent.children.toArray(); entities = new HashSet<>(Arrays.asList(children)); return entities; } - public static int getType(Entity entity) { - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + public static int getType(int entity) { + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(entity, MainItemComponent.class); if (mainItemComponent == null) return UNKNOWN_TYPE; return mainItemComponent.entityType; } - public static Array getByLibraryLink(String link) { - Array result = new Array<>(); - ImmutableArray composites = Sandbox.getInstance().getEngine().getEntitiesFor(Family.all(NodeComponent.class).get()); - for (Entity composite : composites) { - MainItemComponent mainItemComponent = ComponentRetriever.get(composite, MainItemComponent.class); + public static Array getByLibraryLink(String link) { + Array result = new Array<>(); + EntitySubscription subscription = Sandbox.getInstance().getEngine().getAspectSubscriptionManager() + .get(Aspect.all(NodeComponent.class)); + IntBag composites = subscription.getEntities(); + for (int composite : composites.getData()) { + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(composite, MainItemComponent.class); if (mainItemComponent.libraryLink.equals(link)) { result.add(composite); } @@ -279,23 +280,9 @@ public class EntityUtils { return result; } - public static void reInstantiateChildren(Entity entity) { - NodeComponent nodeComponent = ComponentRetriever.get(entity, NodeComponent.class); - if (nodeComponent != null) { - CompositeVO compositeVo = new CompositeVO(); - compositeVo.loadFromEntity(entity); - - entity.remove(NodeComponent.class); - entity.add(new NodeComponent()); - - SceneLoader sceneLoader = Sandbox.getInstance().getSceneControl().sceneLoader; - sceneLoader.getEntityFactory().initAllChildren(Sandbox.getInstance().getEngine(), entity, compositeVo); - } - } - - public static LayerItemVO getEntityLayer(Entity entity) { - ZIndexComponent zIndexComponent = ComponentRetriever.get(entity, ZIndexComponent.class); - LayerMapComponent layerMapComponent = ComponentRetriever.get(entity.getComponent(ParentNodeComponent.class).parentEntity, LayerMapComponent.class); + public static LayerItemVO getEntityLayer(int entity) { + ZIndexComponent zIndexComponent = SandboxComponentRetriever.get(entity, ZIndexComponent.class); + LayerMapComponent layerMapComponent = SandboxComponentRetriever.get(SandboxComponentRetriever.get(entity, ParentNodeComponent.class).parentEntity, LayerMapComponent.class); return layerMapComponent.getLayer(zIndexComponent.layerName); } @@ -306,11 +293,11 @@ public class EntityUtils { * @param root * @param action */ - public static void applyActionRecursivelyOnEntities(Entity root, Consumer action) { + public static void applyActionRecursivelyOnEntities(int root, Consumer action) { action.accept(root); - NodeComponent nodeComponent = ComponentRetriever.get(root, NodeComponent.class); + NodeComponent nodeComponent = SandboxComponentRetriever.get(root, NodeComponent.class); if (nodeComponent != null && nodeComponent.children != null) { - for (Entity targetEntity : nodeComponent.children) { + for (int targetEntity : nodeComponent.children) { applyActionRecursivelyOnEntities(targetEntity, action); } } @@ -325,30 +312,31 @@ public class EntityUtils { } } - public static void removeEntities(ArrayList entityList) { - for (Entity entity : entityList) { - Sandbox.getInstance().getEngine().removeEntity(entity); + public static void removeEntities(ArrayList entityList) { + for (int entity : entityList) { + Sandbox.getInstance().getEngine().delete(entity); } + Sandbox.getInstance().getEngine().process(); } - public static void refreshComponents(Entity entity) { - TextureRegionComponent textureRegionComponent = ComponentRetriever.get(entity, TextureRegionComponent.class); + public static void refreshComponents(int entity) { + TextureRegionComponent textureRegionComponent = SandboxComponentRetriever.get(entity, TextureRegionComponent.class); if (textureRegionComponent != null) { textureRegionComponent.scheduleRefresh(); } - PhysicsBodyComponent physicsBodyComponent = ComponentRetriever.get(entity, PhysicsBodyComponent.class); + PhysicsBodyComponent physicsBodyComponent = SandboxComponentRetriever.get(entity, PhysicsBodyComponent.class); if (physicsBodyComponent != null) { physicsBodyComponent.scheduleRefresh(); } - LightBodyComponent lightBodyComponent = ComponentRetriever.get(entity, LightBodyComponent.class); + LightBodyComponent lightBodyComponent = SandboxComponentRetriever.get(entity, LightBodyComponent.class); if (lightBodyComponent != null) { lightBodyComponent.scheduleRefresh(); } } - public static Entity getEntityFromJson(String jsonString, int entityType, EntityFactory factory, Entity parent) { + public static int getEntityFromJson(String jsonString, int entityType, EntityFactory factory, int parent) { Json json = new Json(); if(entityType == EntityFactory.COMPOSITE_TYPE) { CompositeItemVO vo = json.fromJson(CompositeItemVO.class, jsonString); @@ -390,117 +378,119 @@ public class EntityUtils { LightVO vo = json.fromJson(LightVO.class, jsonString); return factory.createEntity(parent, vo); } - return null; + return -1; } - public static String getJsonStringFromEntity(Entity entity) { + public static String getJsonStringFromEntity(int entity) { Json json = new Json(); - int entityType = ComponentRetriever.get(entity, MainItemComponent.class).entityType; + com.artemis.World engine = Sandbox.getInstance().getEngine(); + int entityType = SandboxComponentRetriever.get(entity, MainItemComponent.class).entityType; if(entityType == EntityFactory.COMPOSITE_TYPE) { CompositeItemVO vo = new CompositeItemVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); return json.toJson(vo); } if(entityType == EntityFactory.IMAGE_TYPE) { SimpleImageVO vo = new SimpleImageVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); return json.toJson(vo); } if(entityType == EntityFactory.NINE_PATCH) { Image9patchVO vo = new Image9patchVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); return json.toJson(vo); } if(entityType == EntityFactory.LABEL_TYPE) { LabelVO vo = new LabelVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); return json.toJson(vo); } if(entityType == EntityFactory.PARTICLE_TYPE) { ParticleEffectVO vo = new ParticleEffectVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); return json.toJson(vo); } if(entityType == EntityFactory.TALOS_TYPE) { TalosVO vo = new TalosVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); return json.toJson(vo); } if(entityType == EntityFactory.SPRITE_TYPE) { SpriteAnimationVO vo = new SpriteAnimationVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); return json.toJson(vo); } if(entityType == EntityFactory.SPINE_TYPE) { SpineVO vo = new SpineVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); return json.toJson(vo); } if(entityType == EntityFactory.COLOR_PRIMITIVE) { ColorPrimitiveVO vo = new ColorPrimitiveVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); return json.toJson(vo); } if(entityType == EntityFactory.LIGHT_TYPE) { LightVO vo = new LightVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); return json.toJson(vo); } return null; } - public static String getJsonStringFromEntities(Set entities) { + public static String getJsonStringFromEntities(Set entities) { CompositeVO holderComposite = new CompositeVO(); - for(Entity entity : entities) { - int entityType = ComponentRetriever.get(entity, MainItemComponent.class).entityType; + com.artemis.World engine = Sandbox.getInstance().getEngine(); + for(int entity : entities) { + int entityType = SandboxComponentRetriever.get(entity, MainItemComponent.class).entityType; if(entityType == EntityFactory.COMPOSITE_TYPE) { CompositeItemVO vo = new CompositeItemVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); holderComposite.sComposites.add(vo); } if(entityType == EntityFactory.IMAGE_TYPE) { SimpleImageVO vo = new SimpleImageVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); holderComposite.sImages.add(vo); } if(entityType == EntityFactory.NINE_PATCH) { Image9patchVO vo = new Image9patchVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); holderComposite.sImage9patchs.add(vo); } if(entityType == EntityFactory.LABEL_TYPE) { LabelVO vo = new LabelVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); holderComposite.sLabels.add(vo); } if(entityType == EntityFactory.PARTICLE_TYPE) { ParticleEffectVO vo = new ParticleEffectVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); holderComposite.sParticleEffects.add(vo); } if(entityType == EntityFactory.TALOS_TYPE) { TalosVO vo = new TalosVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); holderComposite.sTalosVFX.add(vo); } if(entityType == EntityFactory.SPRITE_TYPE) { SpriteAnimationVO vo = new SpriteAnimationVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); holderComposite.sSpriteAnimations.add(vo); } if(entityType == EntityFactory.SPINE_TYPE) { SpineVO vo = new SpineVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); holderComposite.sSpineAnimations.add(vo); } if(entityType == EntityFactory.COLOR_PRIMITIVE) { ColorPrimitiveVO vo = new ColorPrimitiveVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); holderComposite.sColorPrimitives.add(vo); } if(entityType == EntityFactory.LIGHT_TYPE) { LightVO vo = new LightVO(); - vo.loadFromEntity(entity); + vo.loadFromEntity(entity, engine); holderComposite.sLights.add(vo); } } diff --git a/src/main/java/games/rednblack/editor/utils/runtime/SandboxComponentRetriever.java b/src/main/java/games/rednblack/editor/utils/runtime/SandboxComponentRetriever.java new file mode 100644 index 00000000..5df26890 --- /dev/null +++ b/src/main/java/games/rednblack/editor/utils/runtime/SandboxComponentRetriever.java @@ -0,0 +1,12 @@ +package games.rednblack.editor.utils.runtime; + +import com.artemis.Component; +import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.view.stage.Sandbox; + +public class SandboxComponentRetriever { + + public static T get(int entity, Class type) { + return ComponentRetriever.get(entity, type, Sandbox.getInstance().getEngine()); + } +} diff --git a/src/main/java/games/rednblack/editor/view/HyperLap2DScreen.java b/src/main/java/games/rednblack/editor/view/HyperLap2DScreen.java index 960559c0..267f83b2 100644 --- a/src/main/java/games/rednblack/editor/view/HyperLap2DScreen.java +++ b/src/main/java/games/rednblack/editor/view/HyperLap2DScreen.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view; -import com.badlogic.ashley.core.Engine; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Graphics; import com.badlogic.gdx.InputMultiplexer; @@ -55,7 +54,7 @@ public class HyperLap2DScreen implements Screen, InputProcessor { public UIStage uiStage; - private Engine engine; + private com.artemis.World engine; private final HyperLap2DFacade facade; @@ -95,7 +94,8 @@ public class HyperLap2DScreen implements Screen, InputProcessor { if (sandboxBackUI != null) sandboxBackUI.render(deltaTime); sandbox.render(deltaTime); - engine.update(deltaTime); + engine.setDelta(deltaTime); + engine.process(); } uiStage.getViewport().apply(); @@ -289,7 +289,7 @@ public class HyperLap2DScreen implements Screen, InputProcessor { return false; } - public void setEngine(Engine engine) { + public void setEngine(com.artemis.World engine) { this.engine = engine; } diff --git a/src/main/java/games/rednblack/editor/view/HyperLap2DScreenMediator.java b/src/main/java/games/rednblack/editor/view/HyperLap2DScreenMediator.java index 96a71464..162f2c30 100644 --- a/src/main/java/games/rednblack/editor/view/HyperLap2DScreenMediator.java +++ b/src/main/java/games/rednblack/editor/view/HyperLap2DScreenMediator.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view; -import com.badlogic.ashley.core.Engine; import games.rednblack.editor.proxy.ProjectManager; import games.rednblack.editor.proxy.SettingsManager; import games.rednblack.h2d.common.MsgAPI; @@ -72,7 +71,7 @@ public class HyperLap2DScreenMediator extends Mediator { facade = HyperLap2DFacade.getInstance(); SandboxMediator sandboxMediator = facade.retrieveMediator(SandboxMediator.NAME); - Engine engine = sandboxMediator.getViewComponent().getEngine(); + com.artemis.World engine = sandboxMediator.getViewComponent().getEngine(); getViewComponent().setEngine(engine); viewComponent.show(); diff --git a/src/main/java/games/rednblack/editor/view/ItemControlMediator.java b/src/main/java/games/rednblack/editor/view/ItemControlMediator.java index df5baedf..31ac64f2 100644 --- a/src/main/java/games/rednblack/editor/view/ItemControlMediator.java +++ b/src/main/java/games/rednblack/editor/view/ItemControlMediator.java @@ -20,10 +20,10 @@ package games.rednblack.editor.view; import java.util.Set; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.components.ZIndexComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; /** * Created by CyberJoe on 3/18/2015. @@ -39,9 +39,9 @@ public class ItemControlMediator { this.sceneControl = sceneControl; } - public void itemZIndexChange( Set currentSelection, boolean isUp) { - for (Entity item : currentSelection) { - zIndexComponent = ComponentRetriever.get(item, ZIndexComponent.class); + public void itemZIndexChange(Set currentSelection, boolean isUp) { + for (Integer item : currentSelection) { + zIndexComponent = SandboxComponentRetriever.get(item, ZIndexComponent.class); int ammount = 1; if (!isUp) ammount = -1; @@ -52,8 +52,8 @@ public class ItemControlMediator { } } - public void moveItemBy(Entity entity, float x, float y) { - transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + public void moveItemBy(int entity, float x, float y) { + transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); transformComponent.x+=x; transformComponent.y+=y; } diff --git a/src/main/java/games/rednblack/editor/view/SceneControlMediator.java b/src/main/java/games/rednblack/editor/view/SceneControlMediator.java index 32297342..07c28939 100644 --- a/src/main/java/games/rednblack/editor/view/SceneControlMediator.java +++ b/src/main/java/games/rednblack/editor/view/SceneControlMediator.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.utils.viewport.ScreenViewport; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.proxy.ProjectManager; @@ -55,11 +54,6 @@ public class SceneControlMediator { */ private CompositeItemVO rootSceneVO; - /** - * current scene rendering item - */ - private Entity currentScene; - public SceneControlMediator(SceneLoader sceneLoader) { this.sceneLoader = sceneLoader; facade = HyperLap2DFacade.getInstance(); @@ -82,6 +76,7 @@ public class SceneControlMediator { currentSceneVo = sceneLoader.loadScene(sceneName, viewport); rootSceneVO = new CompositeItemVO(currentSceneVo.composite); + Sandbox.getInstance().getEngine().process(); } public void updateAmbientLights() { @@ -92,15 +87,11 @@ public class SceneControlMediator { return rootSceneVO; } - public Entity getCurrentScene() { - return currentScene; - } - public SceneVO getCurrentSceneVO() { return currentSceneVo; } - public Entity getRootEntity() { + public int getRootEntity() { return sceneLoader.getRoot(); } } diff --git a/src/main/java/games/rednblack/editor/view/stage/ItemSelector.java b/src/main/java/games/rednblack/editor/view/stage/ItemSelector.java index b5299334..a4ff478a 100644 --- a/src/main/java/games/rednblack/editor/view/stage/ItemSelector.java +++ b/src/main/java/games/rednblack/editor/view/stage/ItemSelector.java @@ -18,12 +18,12 @@ package games.rednblack.editor.view.stage; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Align; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.SnapshotArray; import games.rednblack.editor.renderer.components.TransformComponent; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.renderer.components.NodeComponent; @@ -56,7 +56,7 @@ public class ItemSelector { private SceneControlMediator sceneControl; /** list of current selected panels */ - private Set currentSelection = new HashSet<>(); + private Set currentSelection = new HashSet<>(); private FollowersUIMediator followersUIMediator; @@ -74,19 +74,19 @@ public class ItemSelector { /** * @return HashMap of selection rectangles that contain panels */ - public Set getCurrentSelection() { + public Set getCurrentSelection() { return currentSelection; } /** * @return one selected item */ - public Entity getSelectedItem() { + public int getSelectedItem() { if(currentSelection.size() > 0) { return currentSelection.iterator().next(); } - return null; + return -1; } /** @@ -107,12 +107,12 @@ public class ItemSelector { /** * @return list of currently selected panels */ - public Set getSelectedItems() { + public Set getSelectedItems() { return currentSelection; } - public BiConsumer broadestItem = (i, acc) -> { + public BiConsumer broadestItem = (i, acc) -> { if (acc.carryVal == null) acc.carryVal = Constants.FLOAT_MIN; EntityBounds bounds = new EntityBounds(i); final float width = bounds.getVisualWidth(); @@ -122,7 +122,7 @@ public class ItemSelector { } }; - public BiConsumer highestItem = (i, acc) -> { + public BiConsumer highestItem = (i, acc) -> { if (acc.carryVal == null) acc.carryVal = Constants.FLOAT_MIN; EntityBounds bounds = new EntityBounds(i); final float height = bounds.getVisualHeight(); @@ -132,7 +132,7 @@ public class ItemSelector { } }; - public BiConsumer rightmostItem = (i, acc) -> { + public BiConsumer rightmostItem = (i, acc) -> { if (acc.carryVal == null) acc.carryVal = Constants.FLOAT_MIN; EntityBounds bounds = new EntityBounds(i); final float x = bounds.getVisualRightX(); @@ -142,7 +142,7 @@ public class ItemSelector { } }; - public BiConsumer leftmostItem = (i, acc) -> { + public BiConsumer leftmostItem = (i, acc) -> { if (acc.carryVal == null) acc.carryVal = Constants.FLOAT_MAX; EntityBounds bounds = new EntityBounds(i); final float x = bounds.getVisualX(); @@ -152,7 +152,7 @@ public class ItemSelector { } }; - public BiConsumer topmostItem = (i, acc) -> { + public BiConsumer topmostItem = (i, acc) -> { if (acc.carryVal == null) acc.carryVal = Constants.FLOAT_MIN; EntityBounds bounds = new EntityBounds(i); final float y = bounds.getVisualTopY(); @@ -161,7 +161,7 @@ public class ItemSelector { acc.carry = i; } }; - public BiConsumer bottommostItem = (i, acc) -> { + public BiConsumer bottommostItem = (i, acc) -> { if (acc.carryVal == null) acc.carryVal = Constants.FLOAT_MAX; EntityBounds bounds = new EntityBounds(i); final float y = bounds.getVisualY(); @@ -177,14 +177,14 @@ public class ItemSelector { */ private static class AccContainer { public Float carryVal = null; - public Entity carry = null; + public int carry = -1; } - public Entity get(BiConsumer checkSelection) { + public int get(BiConsumer checkSelection) { final AccContainer acc = new AccContainer(); - for (Entity entity : currentSelection) { + for (int entity : currentSelection) { checkSelection.accept(entity, acc); } return acc.carry; @@ -212,7 +212,7 @@ public class ItemSelector { * @param item to select * @param removeOthers if set to true this item will become the only selection, otherwise will be added to existing */ - public void setSelection(Entity item, boolean removeOthers) { + public void setSelection(int item, boolean removeOthers) { if (currentSelection.contains(item)) return; if (removeOthers) clearSelections(); @@ -226,13 +226,13 @@ public class ItemSelector { * adds to selection a list of items * @param items list of panels to select */ - public void addSelections(Set items) { - for (Entity item : items) { + public void addSelections(Set items) { + for (int item : items) { setSelection(item, false); } } - public boolean isSelected(Entity entity) { + public boolean isSelected(int entity) { return currentSelection.contains(entity); } @@ -241,7 +241,7 @@ public class ItemSelector { * @param items list of panels to select * @param alsoShow if false, selection will remain hidden at this moment */ - public void setSelections(Set items, boolean alsoShow) { + public void setSelections(Set items, boolean alsoShow) { currentSelection.clear(); if(items == null) { @@ -263,8 +263,8 @@ public class ItemSelector { * remove selection to a list of items * @param items list of panels to remove selection */ - public void releaseSelections(Set items) { - for (Entity item : items) { + public void releaseSelections(Set items) { + for (int item : items) { releaseSelection(item); } } @@ -273,7 +273,7 @@ public class ItemSelector { * Un-selects item * @param item to un-select */ - public void releaseSelection(Entity item) { + public void releaseSelection(int item) { currentSelection.remove(item); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_SELECTION_CHANGED, currentSelection); @@ -292,15 +292,15 @@ public class ItemSelector { /** * Selects all panels on currently active scene */ - public HashSet getAllFreeItems() { - NodeComponent nodeComponent = ComponentRetriever.get(sandbox.getCurrentViewingEntity(), NodeComponent.class); - SnapshotArray childrenEntities = nodeComponent.children; + public HashSet getAllFreeItems() { + NodeComponent nodeComponent = SandboxComponentRetriever.get(sandbox.getCurrentViewingEntity(), NodeComponent.class); + SnapshotArray childrenEntities = nodeComponent.children; - Entity[] array = childrenEntities.toArray(); - HashSet result = new HashSet<>(Arrays.asList(array)); + Integer[] array = childrenEntities.toArray(); + HashSet result = new HashSet<>(Arrays.asList(array)); - for (Iterator i = result.iterator(); i.hasNext();) { - Entity element = i.next(); + for (Iterator i = result.iterator(); i.hasNext();) { + int element = i.next(); LayerItemVO layerItemVO = EntityUtils.getEntityLayer(element); if(layerItemVO != null && layerItemVO.isLocked) { i.remove(); @@ -318,22 +318,22 @@ public class ItemSelector { * removes all selected panels from the scene */ public void removeCurrentSelectedItems() { - for (Entity item : currentSelection) { + for (int item : currentSelection) { followersUIMediator.removeFollower(item); - sandbox.getEngine().removeEntity(item); + sandbox.getEngine().delete(item); } currentSelection.clear(); } - public void alignSelectionsByX(Entity relativeTo, boolean toHighestX) { - if (relativeTo == null) return; + public void alignSelectionsByX(int relativeTo, boolean toHighestX) { + if (relativeTo == -1) return; EntityBounds bounds = new EntityBounds(relativeTo); final float relativeToX = (toHighestX)? (bounds.getVisualRightX()) : bounds.getVisualX(); moveCommandBuilder.clear(); - for (Entity entity : currentSelection) { + for (int entity : currentSelection) { EntityBounds entityBounds = new EntityBounds(entity); final float deltaX = entityBounds.getX() - entityBounds.getVisualX(); final float visualX = relativeToX - ((toHighestX)? 1 : 0) * entityBounds.getVisualWidth(); @@ -343,14 +343,14 @@ public class ItemSelector { moveCommandBuilder.execute(); } - public void alignSelectionsByY(Entity relativeTo, boolean toHighestY) { - if (relativeTo == null) return; + public void alignSelectionsByY(int relativeTo, boolean toHighestY) { + if (relativeTo == -1) return; EntityBounds bounds = new EntityBounds(relativeTo); final float relativeToY = (toHighestY)? bounds.getVisualTopY() : bounds.getVisualY(); moveCommandBuilder.clear(); - for (Entity entity : currentSelection) { + for (int entity : currentSelection) { EntityBounds entityBounds = new EntityBounds(entity); final float deltaY = entityBounds.getY() - entityBounds.getVisualY(); final float visualY = relativeToY - ((toHighestY)? 1 : 0) * entityBounds.getVisualHeight(); @@ -360,14 +360,14 @@ public class ItemSelector { moveCommandBuilder.execute(); } - public void alignSelectionsAtLeftEdge(Entity relativeTo) { - if (relativeTo == null) return; + public void alignSelectionsAtLeftEdge(int relativeTo) { + if (relativeTo == -1) return; EntityBounds bounds = new EntityBounds(relativeTo); final float relativeToX = bounds.getVisualX(); moveCommandBuilder.clear(); - for (Entity entity : currentSelection) { + for (int entity : currentSelection) { if (entity == relativeTo) continue; EntityBounds entityBounds = new EntityBounds(entity); @@ -379,14 +379,14 @@ public class ItemSelector { moveCommandBuilder.execute(); } - public void alignSelectionsAtRightEdge(Entity relativeTo) { - if (relativeTo == null) return; + public void alignSelectionsAtRightEdge(int relativeTo) { + if (relativeTo == -1) return; EntityBounds bounds = new EntityBounds(relativeTo); final float relativeToRightX = bounds.getVisualRightX(); moveCommandBuilder.clear(); - for (Entity entity : currentSelection) { + for (int entity : currentSelection) { if (entity == relativeTo) continue; EntityBounds entityBounds = new EntityBounds(entity); @@ -397,14 +397,14 @@ public class ItemSelector { moveCommandBuilder.execute(); } - public void alignSelectionsAtTopEdge(Entity relativeTo) { - if (relativeTo == null) return; + public void alignSelectionsAtTopEdge(int relativeTo) { + if (relativeTo == -1) return; EntityBounds bounds = new EntityBounds(relativeTo); final float relativeToTopY = bounds.getVisualTopY(); moveCommandBuilder.clear(); - for (Entity entity : currentSelection) { + for (int entity : currentSelection) { if (entity == relativeTo) continue; EntityBounds entityBounds = new EntityBounds(entity); @@ -415,14 +415,14 @@ public class ItemSelector { moveCommandBuilder.execute(); } - public void alignSelectionsAtBottomEdge(Entity relativeTo) { - if (relativeTo == null) return; + public void alignSelectionsAtBottomEdge(int relativeTo) { + if (relativeTo == -1) return; EntityBounds bounds = new EntityBounds(relativeTo); final float relativeToY = bounds.getVisualY(); moveCommandBuilder.clear(); - for (Entity entity : currentSelection) { + for (int entity : currentSelection) { if (entity == relativeTo) continue; EntityBounds entityBounds = new EntityBounds(entity); @@ -434,15 +434,15 @@ public class ItemSelector { moveCommandBuilder.execute(); } - public void alignSelectionsVerticallyCentered(Entity relativeTo) { - if (relativeTo == null) return; + public void alignSelectionsVerticallyCentered(int relativeTo) { + if (relativeTo == -1) return; EntityBounds bounds = new EntityBounds(relativeTo); final float relativeToY = bounds.getVisualY(); final float relativeToHeight = bounds.getVisualHeight(); moveCommandBuilder.clear(); - for (Entity entity : currentSelection) { + for (int entity : currentSelection) { if (entity == relativeTo) continue; EntityBounds entityBounds = new EntityBounds(entity); @@ -454,15 +454,15 @@ public class ItemSelector { moveCommandBuilder.execute(); } - public void alignSelectionsHorizontallyCentered(Entity relativeTo) { - if (relativeTo == null) return; + public void alignSelectionsHorizontallyCentered(int relativeTo) { + if (relativeTo == -1) return; EntityBounds bounds = new EntityBounds(relativeTo); final float relativeToX = bounds.getVisualX(); final float relativeToWidth = bounds.getVisualWidth(); moveCommandBuilder.clear(); - for (Entity entity : currentSelection) { + for (int entity : currentSelection) { if (entity == relativeTo) continue; EntityBounds entityBounds = new EntityBounds(entity); @@ -521,7 +521,7 @@ public class ItemSelector { * @param y */ public void moveSelectedItemsBy(float x, float y) { - for (Entity entity : currentSelection) { + for (int entity : currentSelection) { sandbox.itemControl.moveItemBy(entity, x, y); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_DATA_UPDATED, entity); } @@ -535,8 +535,8 @@ public class ItemSelector { if(currentSelection.isEmpty()) return false; - Entity entity = currentSelection.stream().findFirst().get(); - NodeComponent nodeComponent = entity.getComponent(NodeComponent.class); + int entity = currentSelection.stream().findFirst().get(); + NodeComponent nodeComponent = SandboxComponentRetriever.get(entity, NodeComponent.class); return nodeComponent != null; } diff --git a/src/main/java/games/rednblack/editor/view/stage/Sandbox.java b/src/main/java/games/rednblack/editor/view/stage/Sandbox.java index 9703429f..d7f33840 100644 --- a/src/main/java/games/rednblack/editor/view/stage/Sandbox.java +++ b/src/main/java/games/rednblack/editor/view/stage/Sandbox.java @@ -18,8 +18,6 @@ package games.rednblack.editor.view.stage; -import com.badlogic.ashley.core.Entity; -import com.badlogic.ashley.core.PooledEngine; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application; import com.badlogic.gdx.graphics.Color; @@ -34,11 +32,13 @@ import com.badlogic.gdx.utils.Json; import com.badlogic.gdx.utils.viewport.Viewport; import com.kotcrab.vis.ui.util.ToastManager; import games.rednblack.editor.proxy.*; +import games.rednblack.editor.renderer.SceneConfiguration; import games.rednblack.editor.renderer.physics.PhysicsBodyLoader; import games.rednblack.editor.renderer.systems.LightSystem; import games.rednblack.editor.renderer.systems.ParticleSystem; import games.rednblack.editor.system.ParticleContinuousSystem; import games.rednblack.editor.system.TalosContinuousSystem; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.tools.PanTool; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.h2d.extension.talos.TalosItemType; @@ -81,7 +81,7 @@ public class Sandbox { private final HashMap localClipboard = new HashMap<>(); - private Entity currentViewingEntity; + private int currentViewingEntity = -1; public String currentLoadedSceneFileName; private UIStage uiStage; @@ -129,24 +129,30 @@ public class Sandbox { UIStageMediator uiStageMediator = facade.retrieveMediator(UIStageMediator.NAME); uiStage = uiStageMediator.getViewComponent(); - sceneLoader = new SceneLoader(resourceManager); + SceneConfiguration config = new SceneConfiguration(); + config.setResourceRetriever(resourceManager); // adding spine as external component - sceneLoader.injectExternalItemType(new SpineItemType()); - sceneLoader.injectExternalItemType(new TalosItemType()); + config.addExternalItemType(new SpineItemType()); + config.addExternalItemType(new TalosItemType()); //Remove Physics System and add Adjusting System for box2d objects to follow items and stop world tick - sceneLoader.getEngine().removeSystem(sceneLoader.getEngine().getSystem(PhysicsSystem.class)); - sceneLoader.getEngine().removeSystem(sceneLoader.getEngine().getSystem(LightSystem.class)); + config.removeSystem(PhysicsSystem.class); + config.removeSystem(LightSystem.class); + PhysicsAdjustSystem physicsAdjustSystem = new PhysicsAdjustSystem(); + config.addSystem(physicsAdjustSystem); LightSystem lightSystem = new LightSystem(); - lightSystem.setRayHandler(sceneLoader.getRayHandler()); - sceneLoader.getEngine().addSystem(new PhysicsAdjustSystem(sceneLoader.getWorld())); - sceneLoader.getEngine().addSystem(lightSystem); + config.addSystem(lightSystem); //Remove particle system and use a continuous system for preview purpose - sceneLoader.getEngine().removeSystem(sceneLoader.getEngine().getSystem(ParticleSystem.class)); - sceneLoader.getEngine().addSystem(new ParticleContinuousSystem()); - sceneLoader.getEngine().removeSystem(sceneLoader.getEngine().getSystem(TalosSystem.class)); - sceneLoader.getEngine().addSystem(new TalosContinuousSystem()); + config.removeSystem(ParticleSystem.class); + config.addSystem(new ParticleContinuousSystem()); + config.removeSystem(TalosSystem.class); + config.addSystem(new TalosContinuousSystem()); + + sceneLoader = new SceneLoader(config); + + physicsAdjustSystem.setBox2DWorld(sceneLoader.getWorld()); + lightSystem.setRayHandler(sceneLoader.getRayHandler()); sceneControl = new SceneControlMediator(sceneLoader); itemControl = new ItemControlMediator(sceneControl); @@ -181,7 +187,7 @@ public class Sandbox { return sceneControl; } - public PooledEngine getEngine() { + public com.artemis.World getEngine() { return sceneLoader.getEngine(); } @@ -300,7 +306,7 @@ public class Sandbox { */ public SceneVO sceneVoFromItems() { CompositeVO newVo = new CompositeVO(); - newVo.loadFromEntity(getRootEntity()); + newVo.loadFromEntity(getRootEntity(), getEngine()); newVo.sStickyNotes.putAll(sceneControl.getCurrentSceneVO().composite.sStickyNotes); sceneControl.getCurrentSceneVO().composite = newVo; @@ -311,10 +317,6 @@ public class Sandbox { return selector; } - public Entity getCurrentScene() { - return sceneControl.getCurrentScene(); - } - public void prepareSelectionRectangle(float x, float y) { selectionRec.setOpacity(0.8f); selectionRec.setWidth(0); @@ -369,12 +371,12 @@ public class Sandbox { facade.sendNotification(MsgAPI.LOCK_LINES_CHANGED, lockLines); } - public Entity getRootEntity() { + public int getRootEntity() { return sceneControl.getRootEntity(); } public boolean isViewingRootEntity() { - return currentViewingEntity.equals(getRootEntity()); + return currentViewingEntity == getRootEntity(); } public void overrideAmbientLightInComposite() { @@ -410,17 +412,17 @@ public class Sandbox { return (OrthographicCamera) getViewport().getCamera(); } - public Entity getCurrentViewingEntity() { + public int getCurrentViewingEntity() { return currentViewingEntity; } - public void setCurrentViewingEntity(Entity entity) { + public void setCurrentViewingEntity(int entity) { currentViewingEntity = entity; } public ViewPortComponent getViewportComponent() { - if (getCurrentViewingEntity() == null) return null; - return ComponentRetriever.get(getCurrentViewingEntity(), ViewPortComponent.class); + if (getCurrentViewingEntity() == -1) return null; + return SandboxComponentRetriever.get(getCurrentViewingEntity(), ViewPortComponent.class); } public Viewport getViewport() { diff --git a/src/main/java/games/rednblack/editor/view/stage/SandboxMediator.java b/src/main/java/games/rednblack/editor/view/stage/SandboxMediator.java index cb5e864e..077f4449 100644 --- a/src/main/java/games/rednblack/editor/view/stage/SandboxMediator.java +++ b/src/main/java/games/rednblack/editor/view/stage/SandboxMediator.java @@ -18,9 +18,10 @@ package games.rednblack.editor.view.stage; -import com.badlogic.ashley.core.Engine; -import com.badlogic.ashley.core.Entity; -import com.badlogic.ashley.core.Family; +import com.artemis.Aspect; +import com.artemis.BaseComponentMapper; +import com.artemis.ComponentMapper; +import com.artemis.EntitySubscription; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.badlogic.gdx.math.Vector2; @@ -29,6 +30,7 @@ import com.badlogic.gdx.utils.Align; import com.badlogic.gdx.utils.SnapshotArray; import com.kotcrab.vis.ui.FocusManager; import games.rednblack.editor.utils.KeyBindingsLayout; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.h2d.common.view.tools.Tool; import games.rednblack.editor.HyperLap2DFacade; @@ -156,13 +158,11 @@ public class SandboxMediator extends Mediator { } private void initItemListeners() { - Engine engine = getViewComponent().getEngine(); - Family rootFamily = Family.all(ViewPortComponent.class).get(); - Entity rootEntity = engine.getEntitiesFor(rootFamily).iterator().next(); - NodeComponent nodeComponent = ComponentRetriever.get(rootEntity, NodeComponent.class); - SnapshotArray childrenEntities = nodeComponent.children; + int rootEntity = Sandbox.getInstance().getCurrentViewingEntity(); + NodeComponent nodeComponent = SandboxComponentRetriever.get(rootEntity, NodeComponent.class); + SnapshotArray childrenEntities = nodeComponent.children; - for (Entity child: childrenEntities) { + for (int child: childrenEntities) { addListenerToItem(child); } } @@ -173,11 +173,11 @@ public class SandboxMediator extends Mediator { * * @param entity */ - private void addListenerToItem(Entity entity) { - InputListenerComponent inputListenerComponent = entity.getComponent(InputListenerComponent.class); + private void addListenerToItem(int entity) { + BaseComponentMapper mapper = ComponentMapper.getFor(InputListenerComponent.class, getViewComponent().getEngine()); + InputListenerComponent inputListenerComponent = mapper.get(entity); if(inputListenerComponent == null){ - inputListenerComponent = new InputListenerComponent(); - entity.add(inputListenerComponent); + inputListenerComponent = getViewComponent().getEngine().edit(entity).create(InputListenerComponent.class); } inputListenerComponent.removeAllListener(); inputListenerComponent.addListener(new SandboxItemEventListener(entity)); @@ -192,12 +192,12 @@ public class SandboxMediator extends Mediator { public class SandboxItemEventListener extends EntityClickListener { - public SandboxItemEventListener(final Entity entity) { + public SandboxItemEventListener(final int entity) { } @Override - public boolean touchDown(Entity entity, float x, float y, int pointer, int button) { + public boolean touchDown(int entity, float x, float y, int pointer, int button) { super.touchDown(entity, x, y, pointer, button); setSandboxFocus(); @@ -215,7 +215,7 @@ public class SandboxMediator extends Mediator { @Override - public void touchUp(Entity entity, float x, float y, int pointer, int button) { + public void touchUp(int entity, float x, float y, int pointer, int button) { super.touchUp(entity, x, y, pointer, button); Vector2 coords = getStageCoordinates(); @@ -239,7 +239,7 @@ public class SandboxMediator extends Mediator { } @Override - public void touchDragged(Entity entity, float x, float y, int pointer) { + public void touchDragged(int entity, float x, float y, int pointer) { Vector2 coords = getStageCoordinates(); if (currentSelectedTool != null) { @@ -248,7 +248,7 @@ public class SandboxMediator extends Mediator { } @Override - public boolean scrolled(Entity entity, float amountX, float amountY) { + public boolean scrolled(int entity, float amountX, float amountY) { return false; } @@ -260,7 +260,7 @@ public class SandboxMediator extends Mediator { } @Override - public boolean keyDown(Entity entity, int keycode) { + public boolean keyDown(int entity, int keycode) { Sandbox sandbox = Sandbox.getInstance(); if (sandbox.sceneControl.getCurrentSceneVO() == null) { return false; @@ -348,7 +348,7 @@ public class SandboxMediator extends Mediator { } @Override - public boolean keyUp(Entity entity, int keycode) { + public boolean keyUp(int entity, int keycode) { facade.sendNotification(MsgAPI.ACTION_KEY_UP, keycode); Sandbox sandbox = Sandbox.getInstance(); @@ -372,7 +372,7 @@ public class SandboxMediator extends Mediator { @Override - public boolean touchDown(Entity entity, float x, float y, int pointer, int button) { + public boolean touchDown(int entity, float x, float y, int pointer, int button) { super.touchDown(entity, x, y, pointer, button); setSandboxFocus(); @@ -392,7 +392,7 @@ public class SandboxMediator extends Mediator { } @Override - public void touchUp(Entity entity, float x, float y, int pointer, int button) { + public void touchUp(int entity, float x, float y, int pointer, int button) { super.touchUp(entity, x, y, pointer, button); if(currentSelectedTool != null) { @@ -420,7 +420,7 @@ public class SandboxMediator extends Mediator { } - private void doubleClick(Entity entity, float x, float y) { + private void doubleClick(int entity, float x, float y) { if (currentSelectedTool != null) { Sandbox sandbox = Sandbox.getInstance(); currentSelectedTool.stageMouseDoubleClick(x, y); @@ -428,7 +428,7 @@ public class SandboxMediator extends Mediator { } @Override - public void touchDragged(Entity entity, float x, float y, int pointer) { + public void touchDragged(int entity, float x, float y, int pointer) { if (currentSelectedTool != null) { Sandbox sandbox = Sandbox.getInstance(); currentSelectedTool.stageMouseDragged(x, y); @@ -437,7 +437,7 @@ public class SandboxMediator extends Mediator { @Override - public boolean scrolled(Entity entity, float amountX, float amountY) { + public boolean scrolled(int entity, float amountX, float amountY) { Sandbox sandbox = Sandbox.getInstance(); // well, duh if (amountX == 0 && amountY == 0) return false; diff --git a/src/main/java/games/rednblack/editor/view/stage/UIStageMediator.java b/src/main/java/games/rednblack/editor/view/stage/UIStageMediator.java index 8406d448..7def2bdd 100644 --- a/src/main/java/games/rednblack/editor/view/stage/UIStageMediator.java +++ b/src/main/java/games/rednblack/editor/view/stage/UIStageMediator.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view.stage; -import com.badlogic.ashley.core.Entity; import games.rednblack.h2d.common.MsgAPI; import com.kotcrab.vis.ui.util.dialog.Dialogs; import com.kotcrab.vis.ui.util.dialog.InputDialogListener; @@ -57,7 +56,7 @@ public class UIStageMediator extends Mediator { case MsgAPI.SHOW_ADD_LIBRARY_DIALOG: Sandbox sandbox = Sandbox.getInstance(); - Entity item = notification.getBody(); + int item = notification.getBody(); Dialogs.showInputDialog(sandbox.getUIStage(), "New Library Item ", "Unique Name", new InputDialogListener() { @Override diff --git a/src/main/java/games/rednblack/editor/view/stage/input/EntityClickListener.java b/src/main/java/games/rednblack/editor/view/stage/input/EntityClickListener.java index 3509ce56..e0d42c9f 100644 --- a/src/main/java/games/rednblack/editor/view/stage/input/EntityClickListener.java +++ b/src/main/java/games/rednblack/editor/view/stage/input/EntityClickListener.java @@ -1,6 +1,5 @@ package games.rednblack.editor.view.stage.input; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Buttons; import com.badlogic.gdx.scenes.scene2d.Actor; @@ -27,8 +26,7 @@ public class EntityClickListener implements InputListener { private int tapCount; private long lastTapTime; - /** Create a listener where {@link #clicked(float, float)} is only called for left clicks. - * @see #ClickListener(int) */ + /** Create a listener where is only called for left clicks. */ public EntityClickListener () { } @@ -38,7 +36,7 @@ public class EntityClickListener implements InputListener { } @Override - public boolean touchDown (Entity entity, float x, float y, int pointer, int button) { + public boolean touchDown (int entity, float x, float y, int pointer, int button) { if (pressed) return false; if (pointer == 0 && this.button != -1 && button != this.button) return false; pressed = true; @@ -51,7 +49,7 @@ public class EntityClickListener implements InputListener { } @Override - public void touchDragged (Entity entity, float x, float y, int pointer) { + public void touchDragged (int entity, float x, float y, int pointer) { if (pointer != pressedPointer || cancelled) return; pressed = isOver(entity, x, y); if (pressed && pointer == 0 && button != -1 && !Gdx.input.isButtonPressed(button)) pressed = false; @@ -62,7 +60,7 @@ public class EntityClickListener implements InputListener { } @Override - public void touchUp (Entity entity, float x, float y, int pointer, int button) { + public void touchUp (int entity, float x, float y, int pointer, int button) { if (pointer == pressedPointer) { if (!cancelled) { boolean touchUpOver = isOver(entity, x, y); @@ -83,11 +81,11 @@ public class EntityClickListener implements InputListener { } } - public void enter (Entity entity, float x, float y, int pointer, Actor fromActor) { + public void enter (int entity, float x, float y, int pointer, Actor fromActor) { if (pointer == -1 && !cancelled) over = true; } - public void exit (Entity entity, float x, float y, int pointer, Actor toActor) { + public void exit (int entity, float x, float y, int pointer, Actor toActor) { if (pointer == -1 && !cancelled) over = false; } @@ -98,11 +96,11 @@ public class EntityClickListener implements InputListener { pressed = false; } - public void clicked (Entity entity, float x, float y) { + public void clicked (int entity, float x, float y) { } /** Returns true if the specified position is over the specified actor or within the tap square. */ - public boolean isOver (Entity entity, float x, float y) { + public boolean isOver (int entity, float x, float y) { //TODO this part // Actor hit = actor.hit(x, y, true); // if (hit == null || !hit.isDescendantOf(actor)) return inTapSquare(x, y); @@ -192,31 +190,31 @@ public class EntityClickListener implements InputListener { } @Override - public boolean keyDown(Entity entity, int keycode) { + public boolean keyDown(int entity, int keycode) { // TODO Auto-generated method stub return false; } @Override - public boolean keyUp(Entity entity, int keycode) { + public boolean keyUp(int entity, int keycode) { // TODO Auto-generated method stub return false; } @Override - public boolean keyTyped(Entity entity, char character) { + public boolean keyTyped(int entity, char character) { // TODO Auto-generated method stub return false; } @Override - public boolean mouseMoved(Entity entity, float screenX, float screenY) { + public boolean mouseMoved(int entity, float screenX, float screenY) { // TODO Auto-generated method stub return false; } @Override - public boolean scrolled(Entity entity, float amountX, float amountY) { + public boolean scrolled(int entity, float amountX, float amountY) { // TODO Auto-generated method stub return false; } diff --git a/src/main/java/games/rednblack/editor/view/stage/input/InputListener.java b/src/main/java/games/rednblack/editor/view/stage/input/InputListener.java index 196d726e..402a6160 100644 --- a/src/main/java/games/rednblack/editor/view/stage/input/InputListener.java +++ b/src/main/java/games/rednblack/editor/view/stage/input/InputListener.java @@ -1,23 +1,21 @@ package games.rednblack.editor.view.stage.input; -import com.badlogic.ashley.core.Entity; - public interface InputListener { - boolean keyDown(Entity entity, int keycode); + boolean keyDown(int entity, int keycode); - boolean keyUp(Entity entity, int keycode); + boolean keyUp(int entity, int keycode); - boolean keyTyped(Entity entity, char character); + boolean keyTyped(int entity, char character); - boolean touchDown(Entity entity, float screenX, float screenY, int pointer, int button); + boolean touchDown(int entity, float screenX, float screenY, int pointer, int button); - void touchUp(Entity entity, float screenX, float screenY, int pointer, int button); + void touchUp(int entity, float screenX, float screenY, int pointer, int button); - void touchDragged(Entity entity, float screenX, float screenY, int pointer); + void touchDragged(int entity, float screenX, float screenY, int pointer); - boolean mouseMoved(Entity entity, float screenX, float screenY); + boolean mouseMoved(int entity, float screenX, float screenY); - boolean scrolled(Entity entity, float amountX, float amountY); + boolean scrolled(int entity, float amountX, float amountY); } diff --git a/src/main/java/games/rednblack/editor/view/stage/input/InputListenerComponent.java b/src/main/java/games/rednblack/editor/view/stage/input/InputListenerComponent.java index 28601620..c0a76c45 100644 --- a/src/main/java/games/rednblack/editor/view/stage/input/InputListenerComponent.java +++ b/src/main/java/games/rednblack/editor/view/stage/input/InputListenerComponent.java @@ -1,9 +1,9 @@ package games.rednblack.editor.view.stage.input; -import com.badlogic.ashley.core.Component; +import com.artemis.Component; import com.badlogic.gdx.utils.Array; -public class InputListenerComponent implements Component { +public class InputListenerComponent extends Component { private Array listeners = new Array(1); public void addListener(InputListener listener){ diff --git a/src/main/java/games/rednblack/editor/view/stage/input/SandboxInputAdapter.java b/src/main/java/games/rednblack/editor/view/stage/input/SandboxInputAdapter.java index fa2b98f2..44c2f66e 100644 --- a/src/main/java/games/rednblack/editor/view/stage/input/SandboxInputAdapter.java +++ b/src/main/java/games/rednblack/editor/view/stage/input/SandboxInputAdapter.java @@ -1,6 +1,7 @@ package games.rednblack.editor.view.stage.input; -import com.badlogic.ashley.core.Entity; +import com.artemis.BaseComponentMapper; +import com.artemis.ComponentMapper; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.InputProcessor; import com.badlogic.gdx.math.Intersector; @@ -12,6 +13,7 @@ import games.rednblack.editor.renderer.components.*; import games.rednblack.editor.renderer.data.LayerItemVO; import games.rednblack.editor.utils.EntityBounds; import games.rednblack.editor.utils.runtime.EntityUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.view.stage.SandboxMediator; @@ -21,9 +23,9 @@ import games.rednblack.editor.renderer.utils.ComponentRetriever; public class SandboxInputAdapter implements InputProcessor { private HyperLap2DFacade facade; - private Entity rootEntity; + private int rootEntity; private InputListenerComponent inpputListenerComponent; - private Entity target; + private int target; private Vector2 hitTargetLocalCoordinates = new Vector2(); private Sandbox sandbox; private final EntityBounds tempEntityBounds = new EntityBounds(); @@ -38,7 +40,7 @@ public class SandboxInputAdapter implements InputProcessor { public boolean keyDown(int keycode) { Array sandboxListeners = sandbox.getAllListeners(); for (int i = 0, s = sandboxListeners.size; i < s; i++) { - sandboxListeners.get(i).keyDown(null, keycode); + sandboxListeners.get(i).keyDown(-1, keycode); } return false; @@ -48,7 +50,7 @@ public class SandboxInputAdapter implements InputProcessor { public boolean keyUp(int keycode) { Array sandboxListeners = sandbox.getAllListeners(); for (int i = 0, s = sandboxListeners.size; i < s; i++) { - sandboxListeners.get(i).keyUp(null, keycode); + sandboxListeners.get(i).keyUp(-1, keycode); } return false; } @@ -57,7 +59,7 @@ public class SandboxInputAdapter implements InputProcessor { public boolean keyTyped(char character) { Array sandboxListeners = sandbox.getAllListeners(); for (int i = 0, s = sandboxListeners.size; i < s; i++) { - sandboxListeners.get(i).keyTyped(null, character); + sandboxListeners.get(i).keyTyped(-1, character); } return false; @@ -69,11 +71,11 @@ public class SandboxInputAdapter implements InputProcessor { //Handle Global Listeners than others rootEntity = sandbox.getCurrentViewingEntity(); - if(rootEntity == null){ + if(rootEntity == -1){ return false; } - Viewport viewPort = ComponentRetriever.get(rootEntity, ViewPortComponent.class).viewPort; + Viewport viewPort = SandboxComponentRetriever.get(rootEntity, ViewPortComponent.class).viewPort; if (screenX < viewPort.getScreenX() || screenX >= viewPort.getScreenX() + viewPort.getScreenWidth()) return false; if (Gdx.graphics.getHeight() - screenY < viewPort.getScreenY() || Gdx.graphics.getHeight() - screenY >= viewPort.getScreenY() + viewPort.getScreenHeight()) return false; @@ -82,13 +84,13 @@ public class SandboxInputAdapter implements InputProcessor { screenToSceneCoordinates(rootEntity, hitTargetLocalCoordinates); target = hit(rootEntity, hitTargetLocalCoordinates.x, hitTargetLocalCoordinates.y); - if(target == null){ + if(target == -1){ hitTargetLocalCoordinates.set(screenX, screenY); screenToSceneCoordinates(rootEntity, hitTargetLocalCoordinates); Array sandboxListeners = sandbox.getAllListeners(); for (int i = 0, s = sandboxListeners.size; i < s; i++) { - sandboxListeners.get(i).touchDown(null, hitTargetLocalCoordinates.x, hitTargetLocalCoordinates.y, pointer, button); + sandboxListeners.get(i).touchDown(-1, hitTargetLocalCoordinates.x, hitTargetLocalCoordinates.y, pointer, button); } return false; @@ -97,10 +99,11 @@ public class SandboxInputAdapter implements InputProcessor { hitTargetLocalCoordinates.set(screenX, screenY); screenToSceneCoordinates(rootEntity, hitTargetLocalCoordinates); - inpputListenerComponent = target.getComponent(InputListenerComponent.class); + BaseComponentMapper mapper = ComponentMapper.getFor(InputListenerComponent.class, sandbox.getEngine()); + inpputListenerComponent = mapper.get(target); if(inpputListenerComponent == null) return false; Array listeners = inpputListenerComponent.getAllListeners(); - TransformMathUtils.sceneToLocalCoordinates(target, hitTargetLocalCoordinates); + TransformMathUtils.sceneToLocalCoordinates(target, hitTargetLocalCoordinates, sandbox.getEngine()); for (int j = 0, s = listeners.size; j < s; j++) { if (listeners.get(j).touchDown(target, hitTargetLocalCoordinates.x, hitTargetLocalCoordinates.y, pointer, button)) { return true; @@ -114,28 +117,29 @@ public class SandboxInputAdapter implements InputProcessor { public boolean touchUp(int screenX, int screenY, int pointer, int button) { rootEntity = sandbox.getCurrentViewingEntity(); - if(rootEntity == null){ + if(rootEntity == -1){ return false; } - if(target == null){ + if(target == -1){ hitTargetLocalCoordinates.set(screenX, screenY); screenToSceneCoordinates(rootEntity, hitTargetLocalCoordinates); Array sandboxListeners = sandbox.getAllListeners(); for (int i = 0, s = sandboxListeners.size; i < s; i++) { - sandboxListeners.get(i).touchUp(null, hitTargetLocalCoordinates.x, hitTargetLocalCoordinates.y, pointer, button); + sandboxListeners.get(i).touchUp(-1, hitTargetLocalCoordinates.x, hitTargetLocalCoordinates.y, pointer, button); } return false; } - inpputListenerComponent = target.getComponent(InputListenerComponent.class); + BaseComponentMapper mapper = ComponentMapper.getFor(InputListenerComponent.class, sandbox.getEngine()); + inpputListenerComponent = mapper.get(target); if(inpputListenerComponent == null) return false; Array listeners = inpputListenerComponent.getAllListeners(); for (int j = 0, s = listeners.size; j < s; j++){ listeners.get(j).touchUp(target, screenX, screenY, pointer, button); } - target = null; + target = -1; return true; } @@ -143,22 +147,23 @@ public class SandboxInputAdapter implements InputProcessor { public boolean touchDragged(int screenX, int screenY, int pointer) { rootEntity = sandbox.getCurrentViewingEntity(); - if(rootEntity == null){ + if(rootEntity == -1){ return false; } - if(target == null){ + if(target == -1){ hitTargetLocalCoordinates.set(screenX, screenY); screenToSceneCoordinates(rootEntity, hitTargetLocalCoordinates); Array sandboxListeners = sandbox.getAllListeners(); for (int i = 0, s = sandboxListeners.size; i < s; i++) { - sandboxListeners.get(i).touchDragged(null, hitTargetLocalCoordinates.x, hitTargetLocalCoordinates.y, pointer); + sandboxListeners.get(i).touchDragged(-1, hitTargetLocalCoordinates.x, hitTargetLocalCoordinates.y, pointer); } return false; } - inpputListenerComponent = target.getComponent(InputListenerComponent.class); + BaseComponentMapper mapper = ComponentMapper.getFor(InputListenerComponent.class, sandbox.getEngine()); + inpputListenerComponent = mapper.get(target); if(inpputListenerComponent == null) return false; Array listeners = inpputListenerComponent.getAllListeners(); for (int j = 0, s = listeners.size; j < s; j++){ @@ -188,13 +193,13 @@ public class SandboxInputAdapter implements InputProcessor { public boolean scrolled(float amountX, float amountY) { rootEntity = sandbox.getCurrentViewingEntity(); - if(rootEntity == null){ + if(rootEntity == -1){ return false; } Array sandboxListeners = sandbox.getAllListeners(); for (int i = 0, s = sandboxListeners.size; i < s; i++) { - sandboxListeners.get(i).scrolled(null, amountX, amountY); + sandboxListeners.get(i).scrolled(-1, amountX, amountY); } //TODO scroll for other Entities don't know how deep tis should go all entities or only hit tested @@ -213,16 +218,16 @@ public class SandboxInputAdapter implements InputProcessor { Vector2 tmpVector2 = new Vector2(); - public Entity hit(Entity root, float x, float y){ + public int hit(int root, float x, float y){ Vector2 localCoordinates = tmpVector2.set(x, y); - TransformMathUtils.parentToLocalCoordinates(root, localCoordinates); + TransformMathUtils.parentToLocalCoordinates(root, localCoordinates, sandbox.getEngine()); - NodeComponent nodeComponent = ComponentRetriever.get(root, NodeComponent.class); - SnapshotArray childrenEntities = nodeComponent.children; + NodeComponent nodeComponent = SandboxComponentRetriever.get(root, NodeComponent.class); + SnapshotArray childrenEntities = nodeComponent.children; int n = childrenEntities.size-1; for (int i = n; i >= 0; i--){ - Entity childEntity = childrenEntities.get(i); + int childEntity = childrenEntities.get(i); // get layer locked or not LayerItemVO layerItemVO = EntityUtils.getEntityLayer(childEntity); @@ -234,11 +239,11 @@ public class SandboxInputAdapter implements InputProcessor { return childEntity; } } - return null; + return -1; } - public Vector2 screenToSceneCoordinates (Entity root, Vector2 screenCoords) { - ViewPortComponent viewPortComponent = ComponentRetriever.get(root, ViewPortComponent.class); + public Vector2 screenToSceneCoordinates (int root, Vector2 screenCoords) { + ViewPortComponent viewPortComponent = SandboxComponentRetriever.get(root, ViewPortComponent.class); viewPortComponent.viewPort.unproject(screenCoords); return screenCoords; } diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/ConeLightTool.java b/src/main/java/games/rednblack/editor/view/stage/tools/ConeLightTool.java index 34bd850f..29aaf664 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/ConeLightTool.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/ConeLightTool.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view.stage.tools; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import games.rednblack.editor.factory.ItemFactory; import games.rednblack.editor.renderer.data.LightVO; @@ -47,7 +46,7 @@ public class ConeLightTool extends ItemDropTool { } @Override - public Entity putItem(float x, float y) { + public int putItem(float x, float y) { //LayerItemVO layer = Sandbox.getInstance().getItemFactory().getSelectedLayer(); LightVO vo = new LightVO(); vo.type = LightVO.LightType.CONE; diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/ItemDropTool.java b/src/main/java/games/rednblack/editor/view/stage/tools/ItemDropTool.java index 7fa5baf7..e05ebfbb 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/ItemDropTool.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/ItemDropTool.java @@ -1,6 +1,5 @@ package games.rednblack.editor.view.stage.tools; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.utils.runtime.EntityUtils; /** @@ -14,7 +13,7 @@ public abstract class ItemDropTool extends SelectionTool { @Override public boolean stageMouseDown(float x, float y) { - Entity entity = putItem(x, y); + int entity = putItem(x, y); return false; } @@ -25,7 +24,7 @@ public abstract class ItemDropTool extends SelectionTool { } @Override - public boolean itemMouseDown(Entity entity, float x, float y) { + public boolean itemMouseDown(int entity, float x, float y) { if(checkFilter(entity)) { return super.itemMouseDown(entity, x, y); } else { @@ -36,7 +35,7 @@ public abstract class ItemDropTool extends SelectionTool { } @Override - public void itemMouseDragged(Entity entity, float x, float y) { + public void itemMouseDragged(int entity, float x, float y) { if(checkFilter(entity)) { super.itemMouseDragged(entity, x, y); } @@ -44,13 +43,13 @@ public abstract class ItemDropTool extends SelectionTool { } @Override - public void itemMouseUp(Entity entity, float x, float y) { + public void itemMouseUp(int entity, float x, float y) { if(checkFilter(entity)) { super.itemMouseUp(entity, x, y); } } - protected boolean checkFilter(Entity entity) { + protected boolean checkFilter(int entity) { int[] itemTypes = listItemFilters(); for(int i = 0; i < itemTypes.length; i++) { if(itemTypes[i] == EntityUtils.getType(entity)) { @@ -61,7 +60,7 @@ public abstract class ItemDropTool extends SelectionTool { return false; } - public abstract Entity putItem(float x, float y); + public abstract int putItem(float x, float y); public abstract int[] listItemFilters(); } diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/PanTool.java b/src/main/java/games/rednblack/editor/view/stage/tools/PanTool.java index dfea2b3e..5b63d20f 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/PanTool.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/PanTool.java @@ -1,6 +1,5 @@ package games.rednblack.editor.view.stage.tools; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.math.Vector2; @@ -71,7 +70,7 @@ public class PanTool extends SimpleTool { } @Override - public boolean itemMouseDown(Entity entity, float x, float y) { + public boolean itemMouseDown(int entity, float x, float y) { lastCoordinates.set(Gdx.input.getX(), Gdx.input.getY()); currX = Sandbox.getInstance().getCamera().position.x; currY = Sandbox.getInstance().getCamera().position.y; @@ -79,17 +78,17 @@ public class PanTool extends SimpleTool { } @Override - public void itemMouseUp(Entity entity, float x, float y) { + public void itemMouseUp(int entity, float x, float y) { } @Override - public void itemMouseDragged(Entity entity, float x, float y) { + public void itemMouseDragged(int entity, float x, float y) { doPanning(x, y); } @Override - public void itemMouseDoubleClick(Entity entity, float x, float y) { + public void itemMouseDoubleClick(int entity, float x, float y) { } diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/PointLightTool.java b/src/main/java/games/rednblack/editor/view/stage/tools/PointLightTool.java index 62cfe399..2b1156c7 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/PointLightTool.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/PointLightTool.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view.stage.tools; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import games.rednblack.editor.factory.ItemFactory; import games.rednblack.editor.renderer.data.LightVO; @@ -47,7 +46,7 @@ public class PointLightTool extends ItemDropTool { } @Override - public Entity putItem(float x, float y) { + public int putItem(float x, float y) { LightVO vo = new LightVO(); vo.type = LightVO.LightType.POINT; vo.distance = vo.distance / sandbox.getPixelPerWU(); diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/PolygonTool.java b/src/main/java/games/rednblack/editor/view/stage/tools/PolygonTool.java index c0c692e3..ca5cd5ba 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/PolygonTool.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/PolygonTool.java @@ -18,9 +18,9 @@ package games.rednblack.editor.view.stage.tools; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Input; import com.badlogic.gdx.math.Vector2; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.AddComponentToItemCommand; @@ -95,7 +95,7 @@ public class PolygonTool extends SelectionTool implements PolygonTransformationL } @Override - public boolean itemMouseDown(Entity entity, float x, float y) { + public boolean itemMouseDown(int entity, float x, float y) { lastSelectedMeshFollower = getMeshFollower(entity); return super.itemMouseDown(entity, x, y); } @@ -106,8 +106,8 @@ public class PolygonTool extends SelectionTool implements PolygonTransformationL private void updateSubFollowerList() { Sandbox sandbox = Sandbox.getInstance(); - Set selectedEntities = sandbox.getSelector().getSelectedItems(); - for(Entity entity: selectedEntities) { + Set selectedEntities = sandbox.getSelector().getSelectedItems(); + for(int entity: selectedEntities) { BasicFollower follower = followersUIMediator.getFollower(entity); follower.update(); follower.removeSubFollower(PolygonFollower.class); @@ -125,7 +125,7 @@ public class PolygonTool extends SelectionTool implements PolygonTransformationL @Override public void vertexDown(PolygonFollower follower, int vertexIndex, float x, float y) { - PolygonComponent polygonComponent = ComponentRetriever.get(follower.getEntity(), PolygonComponent.class); + PolygonComponent polygonComponent = SandboxComponentRetriever.get(follower.getEntity(), PolygonComponent.class); currentCommandPayload = UpdatePolygonDataCommand.payloadInitialState(follower.getEntity()); follower.getOriginalPoints().add(vertexIndex, new Vector2(x, y)); @@ -156,13 +156,13 @@ public class PolygonTool extends SelectionTool implements PolygonTransformationL follower.setSelectedAnchor(anchor); lastSelectedMeshFollower = follower; - PolygonComponent polygonComponent = ComponentRetriever.get(follower.getEntity(), PolygonComponent.class); + PolygonComponent polygonComponent = SandboxComponentRetriever.get(follower.getEntity(), PolygonComponent.class); polygonBackup = polygonComponent.vertices.clone(); } @Override public void anchorDragged(PolygonFollower follower, int anchor, float x, float y) { - PolygonComponent polygonComponent = ComponentRetriever.get(follower.getEntity(), PolygonComponent.class); + PolygonComponent polygonComponent = SandboxComponentRetriever.get(follower.getEntity(), PolygonComponent.class); Vector2[] points = follower.getOriginalPoints().toArray(new Vector2[0]); Vector2 diff = dragLastPoint.sub(x, y); @@ -192,7 +192,7 @@ public class PolygonTool extends SelectionTool implements PolygonTransformationL return; } - PolygonComponent polygonComponent = ComponentRetriever.get(follower.getEntity(), PolygonComponent.class); + PolygonComponent polygonComponent = SandboxComponentRetriever.get(follower.getEntity(), PolygonComponent.class); Vector2[] points = follower.getOriginalPoints().toArray(new Vector2[0]); @@ -219,7 +219,7 @@ public class PolygonTool extends SelectionTool implements PolygonTransformationL } @Override - public void keyDown(Entity entity, int keycode) { + public void keyDown(int entity, int keycode) { if(keycode == Input.Keys.DEL || keycode == Input.Keys.FORWARD_DEL) { if(!deleteSelectedAnchor()) { super.keyDown(entity, keycode); @@ -229,7 +229,7 @@ public class PolygonTool extends SelectionTool implements PolygonTransformationL } } - private PolygonFollower getMeshFollower(Entity entity) { + private PolygonFollower getMeshFollower(int entity) { FollowersUIMediator followersUIMediator = HyperLap2DFacade.getInstance().retrieveMediator(FollowersUIMediator.NAME); BasicFollower follower = followersUIMediator.getFollower(entity); @@ -239,7 +239,7 @@ public class PolygonTool extends SelectionTool implements PolygonTransformationL private boolean deleteSelectedAnchor() { PolygonFollower follower = lastSelectedMeshFollower; - PolygonComponent polygonComponent = ComponentRetriever.get(follower.getEntity(), PolygonComponent.class); + PolygonComponent polygonComponent = SandboxComponentRetriever.get(follower.getEntity(), PolygonComponent.class); if(follower != null) { if(polygonComponent == null || polygonComponent.vertices == null || polygonComponent.vertices.length == 0) return false; if(follower.getOriginalPoints().size() <= 3) return false; diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/SelectionTool.java b/src/main/java/games/rednblack/editor/view/stage/tools/SelectionTool.java index c5ec711c..ee6cad3c 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/SelectionTool.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/SelectionTool.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view.stage.tools; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.OrthographicCamera; @@ -27,6 +26,7 @@ import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.viewport.Viewport; import com.kotcrab.vis.ui.util.OsUtils; import games.rednblack.editor.utils.KeyBindingsLayout; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.h2d.common.proxy.CursorManager; @@ -66,8 +66,8 @@ public class SelectionTool extends SimpleTool { private Vector2 directionVector = null; private Vector2 dragMouseStartPosition; - private HashMap dragStartPositions = new HashMap<>(); - private HashMap dragTouchDiff = new HashMap<>(); + private HashMap dragStartPositions = new HashMap<>(); + private HashMap dragTouchDiff = new HashMap<>(); private TransformComponent transformComponent; @@ -136,17 +136,17 @@ public class SelectionTool extends SimpleTool { @Override public void stageMouseDoubleClick(float x, float y) { - Entity currentView = sandbox.getCurrentViewingEntity(); - if (currentView == null) + int currentView = sandbox.getCurrentViewingEntity(); + if (currentView == -1) return; - ParentNodeComponent parentNodeComponent = ComponentRetriever.get(currentView, ParentNodeComponent.class); + ParentNodeComponent parentNodeComponent = SandboxComponentRetriever.get(currentView, ParentNodeComponent.class); if (parentNodeComponent != null) { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ACTION_CAMERA_CHANGE_COMPOSITE, parentNodeComponent.parentEntity); } } @Override - public boolean itemMouseDown(Entity entity, float x, float y) { + public boolean itemMouseDown(int entity, float x, float y) { isItemDown = true; sandbox = Sandbox.getInstance(); HyperLap2DFacade facade = HyperLap2DFacade.getInstance(); @@ -157,14 +157,14 @@ public class SelectionTool extends SimpleTool { if (isShiftPressed()) { if (!currentTouchedItemWasSelected) { // item was not selected, adding it to selection - Set items = new HashSet<>(); + Set items = new HashSet<>(); items.add(entity); facade.sendNotification(MsgAPI.ACTION_ADD_SELECTION, items); } } else { if (!currentTouchedItemWasSelected) { // get selection, add this item to selection - Set items = new HashSet<>(); + Set items = new HashSet<>(); items.add(entity); facade.sendNotification(MsgAPI.ACTION_SET_SELECTION, items); } @@ -173,8 +173,8 @@ public class SelectionTool extends SimpleTool { // remembering local touch position for each of selected boxes, if planning to drag dragStartPositions.clear(); dragTouchDiff.clear(); - for (Entity itemInstance : sandbox.getSelector().getCurrentSelection()) { - transformComponent = ComponentRetriever.get(itemInstance, TransformComponent.class); + for (int itemInstance : sandbox.getSelector().getCurrentSelection()) { + transformComponent = SandboxComponentRetriever.get(itemInstance, TransformComponent.class); if (transformComponent == null) continue; @@ -193,7 +193,7 @@ public class SelectionTool extends SimpleTool { private boolean isItemDown = false; @Override - public void itemMouseDragged(Entity entity, float x, float y) { + public void itemMouseDragged(int entity, float x, float y) { sandbox = Sandbox.getInstance(); if (!isDragging && (Gdx.input.isKeyPressed(Input.Keys.ALT_LEFT) || Gdx.input.isKeyPressed(Input.Keys.ALT_RIGHT))) { // first drag iteration and is copy mode @@ -203,8 +203,8 @@ public class SelectionTool extends SimpleTool { dragStartPositions.clear(); dragTouchDiff.clear(); - for (Entity itemInstance : sandbox.getSelector().getCurrentSelection()) { - transformComponent = ComponentRetriever.get(itemInstance, TransformComponent.class); + for (int itemInstance : sandbox.getSelector().getCurrentSelection()) { + transformComponent = SandboxComponentRetriever.get(itemInstance, TransformComponent.class); dragTouchDiff.put(itemInstance, new Vector2(x - transformComponent.x, y - transformComponent.y)); dragStartPositions.put(itemInstance, new Vector2(transformComponent.x, transformComponent.y)); @@ -246,8 +246,8 @@ public class SelectionTool extends SimpleTool { newY = MathUtils.floor(y / gridSize) * gridSize; // Selection rectangles should move and follow along - for (Entity itemInstance : sandbox.getSelector().getCurrentSelection()) { - transformComponent = ComponentRetriever.get(itemInstance, TransformComponent.class); + for (int itemInstance : sandbox.getSelector().getCurrentSelection()) { + transformComponent = SandboxComponentRetriever.get(itemInstance, TransformComponent.class); if (dragTouchDiff.get(itemInstance) == null) continue; @@ -277,8 +277,8 @@ public class SelectionTool extends SimpleTool { @Override public boolean stageMouseScrolled(float amountX, float amountY) { if (isItemDown) { - for (Entity itemInstance : sandbox.getSelector().getCurrentSelection()) { - transformComponent = ComponentRetriever.get(itemInstance, TransformComponent.class); + for (int itemInstance : sandbox.getSelector().getCurrentSelection()) { + transformComponent = SandboxComponentRetriever.get(itemInstance, TransformComponent.class); float degreeAmount = 3; if (amountX < 0 || amountY < 0) degreeAmount = -3; @@ -297,7 +297,7 @@ public class SelectionTool extends SimpleTool { } @Override - public void itemMouseUp(Entity entity, float x, float y) { + public void itemMouseUp(int entity, float x, float y) { isItemDown = false; sandbox = Sandbox.getInstance(); HyperLap2DFacade facade = HyperLap2DFacade.getInstance(); @@ -305,7 +305,7 @@ public class SelectionTool extends SimpleTool { if (currentTouchedItemWasSelected && !isDragging) { // item was selected (and no dragging was performed), so we need to release it if (isShiftPressed()) { - Set items = new HashSet<>(); + Set items = new HashSet<>(); items.add(entity); facade.sendNotification(MsgAPI.ACTION_RELEASE_SELECTION, items); } @@ -315,8 +315,8 @@ public class SelectionTool extends SimpleTool { if (isDragging) { // sets item position, and puts things into undo-redo que Array payloads = new Array<>(); - for (Entity itemInstance : sandbox.getSelector().getCurrentSelection()) { - transformComponent = ComponentRetriever.get(itemInstance, TransformComponent.class); + for (int itemInstance : sandbox.getSelector().getCurrentSelection()) { + transformComponent = SandboxComponentRetriever.get(itemInstance, TransformComponent.class); Vector2 newPosition = new Vector2(transformComponent.x, transformComponent.y); Vector2 oldPosition = dragStartPositions.get(itemInstance); @@ -335,7 +335,7 @@ public class SelectionTool extends SimpleTool { } @Override - public void itemMouseDoubleClick(Entity item, float x, float y) { + public void itemMouseDoubleClick(int item, float x, float y) { if (sandbox.getSelector().selectionIsComposite()) { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ACTION_CAMERA_CHANGE_COMPOSITE, item); } @@ -355,14 +355,14 @@ public class SelectionTool extends SimpleTool { Viewport viewport = Sandbox.getInstance().getViewport(); - HashSet freeItems = sandbox.getSelector().getAllFreeItems(); + HashSet freeItems = sandbox.getSelector().getAllFreeItems(); // when touch is up, selection process stops, and if any items got "caught" in they should be selected. // hiding selection rectangle sandbox.selectionRec.setOpacity(0.0f); //ArrayList curr = new ArrayList(); - Set curr = new HashSet<>(); + Set curr = new HashSet<>(); Rectangle sR = sandbox.screenToWorld(sandbox.selectionRec.getRect()); draggedRectanglePoints[0] = sR.x; @@ -374,9 +374,9 @@ public class SelectionTool extends SimpleTool { draggedRectanglePoints[6] = sR.x; draggedRectanglePoints[7] = sR.y + sR.height; - for (Entity entity : freeItems) { - transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + for (int entity : freeItems) { + transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); //if (!freeItems.get(i).isLockedByLayer() && Intersector.overlaps(sR, new Rectangle(entity.getX(), entity.getY(), entity.getWidth(), entity.getHeight()))) { @@ -399,14 +399,14 @@ public class SelectionTool extends SimpleTool { facade.sendNotification(MsgAPI.ACTION_SET_SELECTION, curr); } - private boolean isEntityVisible(Entity e) { + private boolean isEntityVisible(int e) { LayerItemVO layer = EntityUtils.getEntityLayer(e); return (layer == null || layer.isVisible); } @Override - public void keyDown(Entity entity, int keycode) { + public void keyDown(int entity, int keycode) { boolean isControlPressed = isControlPressed(); // the amount of pixels by which to move item if moving @@ -427,8 +427,8 @@ public class SelectionTool extends SimpleTool { if (!isControlPressed) { dragStartPositions.clear(); - for (Entity itemInstance : sandbox.getSelector().getCurrentSelection()) { - transformComponent = ComponentRetriever.get(itemInstance, TransformComponent.class); + for (int itemInstance : sandbox.getSelector().getCurrentSelection()) { + transformComponent = SandboxComponentRetriever.get(itemInstance, TransformComponent.class); if (transformComponent != null) dragStartPositions.put(itemInstance, new Vector2(transformComponent.x, transformComponent.y)); } @@ -452,8 +452,8 @@ public class SelectionTool extends SimpleTool { // sets item position, and puts things into undo-redo que Array payloads = new Array<>(); - for (Entity itemInstance : sandbox.getSelector().getCurrentSelection()) { - transformComponent = ComponentRetriever.get(itemInstance, TransformComponent.class); + for (int itemInstance : sandbox.getSelector().getCurrentSelection()) { + transformComponent = SandboxComponentRetriever.get(itemInstance, TransformComponent.class); if (transformComponent == null) continue; Vector2 newPosition = new Vector2(transformComponent.x, transformComponent.y); @@ -480,7 +480,7 @@ public class SelectionTool extends SimpleTool { } @Override - public void keyUp(Entity entity, int keycode) { + public void keyUp(int entity, int keycode) { } diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/SimpleTool.java b/src/main/java/games/rednblack/editor/view/stage/tools/SimpleTool.java index 1b40550a..607c2aba 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/SimpleTool.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/SimpleTool.java @@ -1,6 +1,5 @@ package games.rednblack.editor.view.stage.tools; -import com.badlogic.ashley.core.Entity; import games.rednblack.h2d.common.view.tools.Tool; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.view.stage.Sandbox; @@ -19,9 +18,9 @@ public abstract class SimpleTool implements Tool { @Override public void initTool() { Sandbox sandbox = Sandbox.getInstance(); - Set currSelection = sandbox.getSelector().getCurrentSelection(); + Set currSelection = sandbox.getSelector().getCurrentSelection(); FollowersUIMediator followersUIMediator = HyperLap2DFacade.getInstance().retrieveMediator(FollowersUIMediator.NAME); - for(Entity entity: currSelection) { + for(int entity: currSelection) { BasicFollower follower = followersUIMediator.getFollower(entity); if(follower instanceof NormalSelectionFollower) { NormalSelectionFollower selectionFollower = (NormalSelectionFollower) follower; @@ -56,22 +55,22 @@ public abstract class SimpleTool implements Tool { } @Override - public boolean itemMouseDown(Entity entity, float x, float y) { + public boolean itemMouseDown(int entity, float x, float y) { return false; } @Override - public void itemMouseUp(Entity entity, float x, float y) { + public void itemMouseUp(int entity, float x, float y) { } @Override - public void itemMouseDragged(Entity entity, float x, float y) { + public void itemMouseDragged(int entity, float x, float y) { } @Override - public void itemMouseDoubleClick(Entity entity, float x, float y) { + public void itemMouseDoubleClick(int entity, float x, float y) { } @@ -81,12 +80,12 @@ public abstract class SimpleTool implements Tool { } @Override - public void keyDown(Entity entity, int keycode) { + public void keyDown(int entity, int keycode) { } @Override - public void keyUp(Entity entity, int keycode) { + public void keyUp(int entity, int keycode) { } } diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/TextTool.java b/src/main/java/games/rednblack/editor/view/stage/tools/TextTool.java index 5015df16..18833265 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/TextTool.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/TextTool.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view.stage.tools; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Align; @@ -78,12 +77,12 @@ public class TextTool extends ItemDropTool { } @Override - public Entity putItem(float x, float y) { + public int putItem(float x, float y) { if (getFontFamily() == null || getFontFamily().equals("")) { NativeDialogs.showError("No Font detected on your System.\n" + SystemUtils.OS_NAME + " " + SystemUtils.OS_VERSION + " (HyperLap2D v" + AppConfig.getInstance().versionString + ")"); - return null; + return -1; } return ItemFactory.get().createLabel(this, new Vector2(x, y)); } diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/TransformTool.java b/src/main/java/games/rednblack/editor/view/stage/tools/TransformTool.java index ddd54074..8138a154 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/TransformTool.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/TransformTool.java @@ -18,11 +18,11 @@ package games.rednblack.editor.view.stage.tools; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Input; import com.badlogic.gdx.math.Vector2; import com.kotcrab.vis.ui.util.OsUtils; import games.rednblack.editor.utils.KeyBindingsLayout; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.tools.transformStrategy.*; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; @@ -66,7 +66,7 @@ public class TransformTool extends SelectionTool implements FollowerTransformati private boolean fixCursor = false; - public void execute(Vector2 mouseInitialCoordinates, Vector2 mousePointStage, int anchor, Entity entity) { + public void execute(Vector2 mouseInitialCoordinates, Vector2 mousePointStage, int anchor, int entity) { float mouseDx = mousePointStage.x - mouseInitialCoordinates.x; float mouseDy = mousePointStage.y - mouseInitialCoordinates.y; @@ -107,7 +107,7 @@ public class TransformTool extends SelectionTool implements FollowerTransformati public void handleNotification(INotification notification) { switch (notification.getName()) { case MsgAPI.NEW_ITEM_ADDED: - updateListeners((Entity) notification.getBody()); + updateListeners((int) notification.getBody()); break; } } @@ -119,28 +119,28 @@ public class TransformTool extends SelectionTool implements FollowerTransformati } @Override - public void itemMouseUp(Entity entity, float x, float y) { + public void itemMouseUp(int entity, float x, float y) { super.itemMouseUp(entity, x, y); updateListeners(); } private void updateListeners() { Sandbox sandbox = Sandbox.getInstance(); - Set selectedEntities = sandbox.getSelector().getSelectedItems(); + Set selectedEntities = sandbox.getSelector().getSelectedItems(); updateListeners(selectedEntities); } - private void updateListeners(Entity entity) { - Set entities = new HashSet<>(); + private void updateListeners(int entity) { + Set entities = new HashSet<>(); entities.add(entity); updateListeners(entities); } - private void updateListeners(Set entities) { + private void updateListeners(Set entities) { FollowersUIMediator followersUIMediator = HyperLap2DFacade.getInstance().retrieveMediator(FollowersUIMediator.NAME); followersUIMediator.clearAllListeners(); - for (Entity entity : entities) { + for (int entity : entities) { if (followersUIMediator.getFollower(entity) != null) followersUIMediator.getFollower(entity).setFollowerListener(this); } @@ -152,9 +152,9 @@ public class TransformTool extends SelectionTool implements FollowerTransformati Sandbox sandbox = Sandbox.getInstance(); - commandBuilder.begin(follower.getEntity()); + commandBuilder.begin(follower.getEntity(), Sandbox.getInstance().getEngine()); - TransformComponent transformComponent = ComponentRetriever.get(follower.getEntity(), TransformComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(follower.getEntity(), TransformComponent.class); Vector2 mousePoint = sandbox.screenToWorld(x, y); mouseInitialCoordinates.set(mousePoint.x, mousePoint.y); @@ -177,7 +177,7 @@ public class TransformTool extends SelectionTool implements FollowerTransformati break; } - commandBuilder.begin(follower.getEntity()); + commandBuilder.begin(follower.getEntity(), sandbox.getEngine()); if (anchor == NormalSelectionFollower.ROTATION_LT || anchor == NormalSelectionFollower.ROTATION_RT || diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/AbstractTransformStrategy.java b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/AbstractTransformStrategy.java index 8670cb53..6e0be7b6 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/AbstractTransformStrategy.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/AbstractTransformStrategy.java @@ -1,6 +1,5 @@ package games.rednblack.editor.view.stage.tools.transformStrategy; - import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Vector2; import games.rednblack.editor.renderer.components.TransformComponent; diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/BasicStrategy.java b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/BasicStrategy.java index a413d1a0..00502a94 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/BasicStrategy.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/BasicStrategy.java @@ -1,6 +1,5 @@ package games.rednblack.editor.view.stage.tools.transformStrategy; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.badlogic.gdx.math.Vector2; @@ -9,6 +8,7 @@ import games.rednblack.editor.renderer.components.DimensionsComponent; import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.RoundUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.ui.properties.panels.UIBasicItemPropertiesMediator; import games.rednblack.h2d.common.command.TransformCommandBuilder; import games.rednblack.editor.utils.runtime.EntityUtils; @@ -29,9 +29,9 @@ public class BasicStrategy extends AbstractTransformStrategy { private final Facade facade = HyperLap2DFacade.getInstance(); @Override - public void calculate(float mouseDx, float mouseDy, int anchor, Entity entity, TransformCommandBuilder transformCommandBuilder, Vector2 mousePointStage, float lastTransformAngle, float lastEntityAngle) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + public void calculate(float mouseDx, float mouseDy, int anchor, int entity, TransformCommandBuilder transformCommandBuilder, Vector2 mousePointStage, float lastTransformAngle, float lastEntityAngle) { + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); float scaleX = transformComponent.scaleX * (transformComponent.flipX ? -1 : 1); float scaleY = transformComponent.scaleY * (transformComponent.flipY ? -1 : 1); diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/ColorPrimitiveStrategy.java b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/ColorPrimitiveStrategy.java index ae929b3f..cc26d9a7 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/ColorPrimitiveStrategy.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/ColorPrimitiveStrategy.java @@ -1,18 +1,18 @@ package games.rednblack.editor.view.stage.tools.transformStrategy; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import games.rednblack.editor.renderer.components.DimensionsComponent; import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.command.TransformCommandBuilder; import games.rednblack.editor.view.ui.followers.NormalSelectionFollower; public class ColorPrimitiveStrategy extends AbstractTransformStrategy { @Override - public void calculate(float mouseDx, float mouseDy, int anchor, Entity entity, TransformCommandBuilder transformCommandBuilder, Vector2 mousePoint, float lastTransformAngle, float lastEntityAngle) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + public void calculate(float mouseDx, float mouseDy, int anchor, int entity, TransformCommandBuilder transformCommandBuilder, Vector2 mousePoint, float lastTransformAngle, float lastEntityAngle) { + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); float newX = transformComponent.x; float newY = transformComponent.y; diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/CompositeStrategy.java b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/CompositeStrategy.java index 6851215d..32ae095b 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/CompositeStrategy.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/CompositeStrategy.java @@ -1,12 +1,11 @@ package games.rednblack.editor.view.stage.tools.transformStrategy; -import com.badlogic.ashley.core.ComponentMapper; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.SnapshotArray; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.ui.properties.panels.UIBasicItemPropertiesMediator; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; @@ -27,7 +26,6 @@ import java.util.*; */ public class CompositeStrategy extends AbstractTransformStrategy { - private ComponentMapper nodeMapper = ComponentMapper.getFor(NodeComponent.class); private HashMap childrenInitialPositions = new HashMap<>(); private HashMap childrenFinalPositions = new HashMap<>(); private final Array payloads = new Array<>(); @@ -43,13 +41,13 @@ public class CompositeStrategy extends AbstractTransformStrategy { private final Facade facade = HyperLap2DFacade.getInstance(); - public void getInitialPositions(Entity entity) { + public void getInitialPositions(int entity) { getParentState(entity, parentInitialPosition, parentInitialSize); childrenInitialPositions.clear(); getChildrenPositions(entity, childrenInitialPositions); } - public void swapItemFinalAndInitialStates(Entity entity) { + public void swapItemFinalAndInitialStates(int entity) { childrenFinalPositions.clear(); getChildrenPositions(entity, childrenFinalPositions); getParentState(entity, parentFinalPosition, parentFinalSize); @@ -60,7 +58,7 @@ public class CompositeStrategy extends AbstractTransformStrategy { sendResizePositionNotification(entity); } - private void sendResizePositionNotification(Entity entity) { + private void sendResizePositionNotification(int entity) { payloads.clear(); payloads.add(parentEntity(entity)); for (Map.Entry entrySet : childrenFinalPositions.entrySet()) { @@ -73,17 +71,17 @@ public class CompositeStrategy extends AbstractTransformStrategy { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ACTION_ITEM_AND_CHILDREN_TO, payloads); } - private void setParentState(Entity entity, Vector2 position, Vector2 size) { + private void setParentState(int entity, Vector2 position, Vector2 size) { EntityUtils.setPosition(entity, position); EntityUtils.setSize(entity, size); } - private void getParentState(Entity entity, Vector2 position, Vector2 size) { + private void getParentState(int entity, Vector2 position, Vector2 size) { EntityUtils.getPosition(entity, position); EntityUtils.getSize(entity, size); } - private Object[] parentEntity(Entity entity) { + private Object[] parentEntity(int entity) { Object[] obj = new Object[3]; obj[0] = entity; obj[1] = new Vector2(parentFinalPosition); @@ -91,11 +89,11 @@ public class CompositeStrategy extends AbstractTransformStrategy { return obj; } - private void getChildrenPositions(Entity parentEntity, HashMap entityPos) { - NodeComponent nodeComponent = nodeMapper.get(parentEntity); + private void getChildrenPositions(int parentEntity, HashMap entityPos) { + NodeComponent nodeComponent = SandboxComponentRetriever.get(parentEntity, NodeComponent.class); if (nodeComponent != null) { - for (Entity entity : nodeComponent.children) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + for (int entity : nodeComponent.children) { + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); Vector2 currentEntityPos = new Vector2(transformComponent.x, transformComponent.y); entityPos.put(EntityUtils.getEntityId(entity), currentEntityPos); } @@ -106,15 +104,15 @@ public class CompositeStrategy extends AbstractTransformStrategy { for (Map.Entry entrySet : posMap.entrySet()) { Integer id = entrySet.getKey(); Vector2 position = entrySet.getValue(); - Entity entity = EntityUtils.getByUniqueId(id); + int entity = EntityUtils.getByUniqueId(id); EntityUtils.setPosition(entity, position); } } @Override - public void calculate(float mouseDx, float mouseDy, int anchor, Entity entity, TransformCommandBuilder transformCommandBuilder, Vector2 mousePointStage, float lastTransformAngle, float lastEntityAngle) { - CompositeTransformComponent component = entity.getComponent(CompositeTransformComponent.class); - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + public void calculate(float mouseDx, float mouseDy, int anchor, int entity, TransformCommandBuilder transformCommandBuilder, Vector2 mousePointStage, float lastTransformAngle, float lastEntityAngle) { + CompositeTransformComponent component = SandboxComponentRetriever.get(entity, CompositeTransformComponent.class); + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); float[] horizontal = calculateSizeAndXyAmount(mouseDx, mouseDy, transformComponent.rotation, tmp1); float[] vertical = calculateSizeAndXyAmount(mouseDx, mouseDy, transformComponent.rotation + 90, tmp2); @@ -122,7 +120,7 @@ public class CompositeStrategy extends AbstractTransformStrategy { float deltaH = vertical[0] / transformComponent.scaleY; if (!component.automaticResize) { - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); float newWidth = dimensionsComponent.width; float newHeight = dimensionsComponent.height; @@ -246,11 +244,10 @@ public class CompositeStrategy extends AbstractTransformStrategy { || (mediator != null && mediator.isXYScaleLinked()); } - private void move(Entity node, float x, float y) { - ComponentMapper transMapper = ComponentMapper.getFor(TransformComponent.class); - SnapshotArray nodeEntity = node.getComponent(NodeComponent.class).children; - for (Entity child : nodeEntity) { - TransformComponent transformComponent = transMapper.get(child); + private void move(int node, float x, float y) { + SnapshotArray nodeEntity = SandboxComponentRetriever.get(node, NodeComponent.class).children; + for (int child : nodeEntity) { + TransformComponent transformComponent = SandboxComponentRetriever.get(child, TransformComponent.class); transformComponent.x += x; transformComponent.y += y; } diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/ITransformStrategy.java b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/ITransformStrategy.java index 30dea9eb..bac47c8b 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/ITransformStrategy.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/ITransformStrategy.java @@ -1,6 +1,5 @@ package games.rednblack.editor.view.stage.tools.transformStrategy; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import games.rednblack.h2d.common.command.TransformCommandBuilder; @@ -8,5 +7,5 @@ import games.rednblack.h2d.common.command.TransformCommandBuilder; * Created by Sasun Poghosyan on 4/13/2016. */ public interface ITransformStrategy { - void calculate(float mouseDx, float mouseDy, int anchor, Entity entity, TransformCommandBuilder transformCommandBuilder, Vector2 mousePoint, float lastTransformAngle, float lastEntityAngle); + void calculate(float mouseDx, float mouseDy, int anchor, int entity, TransformCommandBuilder transformCommandBuilder, Vector2 mousePoint, float lastTransformAngle, float lastEntityAngle); } diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/LabelStrategy.java b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/LabelStrategy.java index c500c369..6e0397c0 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/LabelStrategy.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/LabelStrategy.java @@ -1,19 +1,19 @@ package games.rednblack.editor.view.stage.tools.transformStrategy; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import games.rednblack.editor.renderer.components.DimensionsComponent; import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.command.TransformCommandBuilder; import games.rednblack.editor.view.ui.followers.NormalSelectionFollower; public class LabelStrategy extends AbstractTransformStrategy { @Override - public void calculate(float mouseDx, float mouseDy, int anchor, Entity entity, TransformCommandBuilder transformCommandBuilder, Vector2 mousePoint, float lastTransformAngle, float lastEntityAngle) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + public void calculate(float mouseDx, float mouseDy, int anchor, int entity, TransformCommandBuilder transformCommandBuilder, Vector2 mousePoint, float lastTransformAngle, float lastEntityAngle) { + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); float newX = transformComponent.x; float newY = transformComponent.y; diff --git a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/NinePatchStrategy.java b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/NinePatchStrategy.java index 5ce34faa..a65753a5 100644 --- a/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/NinePatchStrategy.java +++ b/src/main/java/games/rednblack/editor/view/stage/tools/transformStrategy/NinePatchStrategy.java @@ -1,11 +1,11 @@ package games.rednblack.editor.view.stage.tools.transformStrategy; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import games.rednblack.editor.renderer.components.DimensionsComponent; import games.rednblack.editor.renderer.components.NinePatchComponent; import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.command.TransformCommandBuilder; import games.rednblack.editor.view.ui.followers.NormalSelectionFollower; @@ -15,16 +15,16 @@ import games.rednblack.editor.view.ui.followers.NormalSelectionFollower; public class NinePatchStrategy extends AbstractTransformStrategy { @Override - public void calculate(float mouseDx, float mouseDy, int anchor, Entity entity, TransformCommandBuilder transformCommandBuilder, Vector2 mousePointStage, float lastTransformAngle, float lastEntityAngle) { - TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - DimensionsComponent dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + public void calculate(float mouseDx, float mouseDy, int anchor, int entity, TransformCommandBuilder transformCommandBuilder, Vector2 mousePointStage, float lastTransformAngle, float lastEntityAngle) { + TransformComponent transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); float newX = transformComponent.x; float newY = transformComponent.y; float newWidth = dimensionsComponent.width; float newHeight = dimensionsComponent.height; - NinePatchComponent ninePatchComponent = ComponentRetriever.get(entity, NinePatchComponent.class); + NinePatchComponent ninePatchComponent = SandboxComponentRetriever.get(entity, NinePatchComponent.class); float minWidth = ninePatchComponent.ninePatch.getTotalWidth(); float minHeight = ninePatchComponent.ninePatch.getTotalHeight(); diff --git a/src/main/java/games/rednblack/editor/view/ui/FollowersUIMediator.java b/src/main/java/games/rednblack/editor/view/ui/FollowersUIMediator.java index 321bc9d4..c75fd626 100644 --- a/src/main/java/games/rednblack/editor/view/ui/FollowersUIMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/FollowersUIMediator.java @@ -18,7 +18,7 @@ package games.rednblack.editor.view.ui; -import com.badlogic.ashley.core.Entity; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.CompositeCameraChangeCommand; @@ -45,7 +45,7 @@ public class FollowersUIMediator extends Mediator { private static final String TAG = FollowersUIMediator.class.getCanonicalName(); public static final String NAME = TAG; - private final HashMap followers = new HashMap<>(); + private final HashMap followers = new HashMap<>(); public FollowersUIMediator() { super(NAME, new FollowersUI()); @@ -130,7 +130,7 @@ public class FollowersUIMediator extends Mediator { } } - private void clearAllSubFollowersExceptNew(Set items) { + private void clearAllSubFollowersExceptNew(Set items) { for (BasicFollower follower : followers.values()) { if(!items.contains(follower)) { if(follower instanceof NormalSelectionFollower) { @@ -140,9 +140,9 @@ public class FollowersUIMediator extends Mediator { } } - private void setNewSelectionConfiguration(Set items) { + private void setNewSelectionConfiguration(Set items) { followers.values().forEach(games.rednblack.editor.view.ui.followers.BasicFollower::hide); - for (Entity item : items) { + for (int item : items) { if (followers.get(item) != null) followers.get(item).show(); } @@ -151,9 +151,9 @@ public class FollowersUIMediator extends Mediator { private void createFollowersForAllVisible() { removeAllfollowers(); Sandbox sandbox = Sandbox.getInstance(); - NodeComponent nodeComponent = ComponentRetriever.get(sandbox.getCurrentViewingEntity(), NodeComponent.class); + NodeComponent nodeComponent = SandboxComponentRetriever.get(sandbox.getCurrentViewingEntity(), NodeComponent.class); - for (Entity entity: nodeComponent.children) { + for (int entity: nodeComponent.children) { createFollower(entity); } } @@ -163,17 +163,17 @@ public class FollowersUIMediator extends Mediator { followers.clear(); } - private void hideAllFollowers(Set items) { + private void hideAllFollowers(Set items) { if (followers != null) { - for (Entity item : items) { + for (int item : items) { followers.get(item).hide(); } } } - private void showAllFollowers(Set items) { + private void showAllFollowers(Set items) { if (followers != null) { - for (Entity item : items) { + for (int item : items) { if (followers.get(item) != null) followers.get(item).show(); } @@ -184,7 +184,7 @@ public class FollowersUIMediator extends Mediator { followers.values().forEach(games.rednblack.editor.view.ui.followers.BasicFollower::update); } - public void createFollower(Entity entity) { + public void createFollower(int entity) { BasicFollower follower = FollowerFactory.createFollower(entity); viewComponent.addActor(follower); followers.put(entity, follower); @@ -193,7 +193,7 @@ public class FollowersUIMediator extends Mediator { follower.handleNotification(new Notification(MsgAPI.TOOL_SELECTED, sandboxMediator.getCurrentSelectedToolName())); } - public void removeFollower(Entity entity) { + public void removeFollower(int entity) { BasicFollower follower = followers.remove(entity); if (follower != null) follower.remove(); @@ -203,7 +203,7 @@ public class FollowersUIMediator extends Mediator { followers.values().forEach(games.rednblack.editor.view.ui.followers.BasicFollower::clearFollowerListener); } - public BasicFollower getFollower(Entity entity) { + public BasicFollower getFollower(int entity) { return followers.get(entity); } } diff --git a/src/main/java/games/rednblack/editor/view/ui/box/UICompositeHierarchyMediator.java b/src/main/java/games/rednblack/editor/view/ui/box/UICompositeHierarchyMediator.java index 9f3ad27a..533c935d 100644 --- a/src/main/java/games/rednblack/editor/view/ui/box/UICompositeHierarchyMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/box/UICompositeHierarchyMediator.java @@ -1,7 +1,7 @@ package games.rednblack.editor.view.ui.box; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.utils.Array; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.CompositeCameraChangeCommand; @@ -58,25 +58,25 @@ public class UICompositeHierarchyMediator extends Mediator } } - private void buildCompositeTree(Entity entity) { + private void buildCompositeTree(int entity) { viewComponent.clearItems(); Array items = new Array<>(); ParentNodeComponent parentNodeComponent; - Entity currEntity = entity; + int currEntity = entity; do { CompositeHierarchyItem item = new CompositeHierarchyItem(EntityUtils.getItemName(currEntity), EntityUtils.getEntityId(currEntity)); - parentNodeComponent = ComponentRetriever.get(currEntity, ParentNodeComponent.class); + parentNodeComponent = SandboxComponentRetriever.get(currEntity, ParentNodeComponent.class); if (parentNodeComponent != null) { currEntity = parentNodeComponent.parentEntity; item.isRoot = true; } items.add(item); - } while (parentNodeComponent != null); + } while (parentNodeComponent != null && currEntity != -1); items.reverse(); @@ -105,7 +105,7 @@ public class UICompositeHierarchyMediator extends Mediator //updateOriginalItem(scenes.get(scenes.size() - 1), commands.sceneControl.getCurrentScene()); } - private void updateOriginalItem(CompositeItemVO updatableVo, Entity currItem) { + private void updateOriginalItem(CompositeItemVO updatableVo, int currItem) { //TODO fix and uncomment // updatableVo.update(new CompositeItemVO(currItem.getDataVO().composite)); // diff --git a/src/main/java/games/rednblack/editor/view/ui/box/UIItemsTreeBox.java b/src/main/java/games/rednblack/editor/view/ui/box/UIItemsTreeBox.java index b56477a2..90129bc4 100644 --- a/src/main/java/games/rednblack/editor/view/ui/box/UIItemsTreeBox.java +++ b/src/main/java/games/rednblack/editor/view/ui/box/UIItemsTreeBox.java @@ -21,13 +21,11 @@ package games.rednblack.editor.view.ui.box; import java.util.Comparator; import java.util.Set; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.ui.Cell; import com.badlogic.gdx.scenes.scene2d.ui.Tree; import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.scenes.scene2d.utils.Selection; -import com.badlogic.gdx.utils.Align; import com.badlogic.gdx.utils.Array; import com.kotcrab.vis.ui.widget.*; import games.rednblack.editor.HyperLap2DFacade; @@ -37,6 +35,7 @@ import games.rednblack.editor.renderer.components.ParentNodeComponent; import games.rednblack.editor.renderer.components.ZIndexComponent; import games.rednblack.editor.renderer.factory.EntityFactory; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.h2d.common.view.ui.StandardWidgetsFactory; import games.rednblack.editor.utils.runtime.EntityUtils; @@ -49,7 +48,7 @@ public class UIItemsTreeBox extends UICollapsibleBox { private Tree tree; private UIItemsTreeNode rootNode; - private Set lastSelection; + private Set lastSelection; private final VisImageButton zUp, zDown; @@ -90,7 +89,7 @@ public class UIItemsTreeBox extends UICollapsibleBox { UIItemsTreeNode rootTreeNode; - public void init(Entity rootScene) { + public void init(int rootScene) { sandbox = Sandbox.getInstance(); treeTable.clear(); @@ -121,14 +120,14 @@ public class UIItemsTreeBox extends UICollapsibleBox { tree.updateRootNodes(); } - private UIItemsTreeNode addTreeRoot(Entity entity, UIItemsTreeNode parentNode) { // was like this addTreeRoot(CompositeItem compoiteItem, Node parentNode) + private UIItemsTreeNode addTreeRoot(int entity, UIItemsTreeNode parentNode) { // was like this addTreeRoot(CompositeItem compoiteItem, Node parentNode) UIItemsTreeNode node = addTreeNode(entity, parentNode); if (parentNode == null) rootNode = node; - NodeComponent nodeComponent = ComponentRetriever.get(entity, NodeComponent.class); + NodeComponent nodeComponent = SandboxComponentRetriever.get(entity, NodeComponent.class); if(nodeComponent != null) { - for (Entity item : nodeComponent.children) { + for (int item : nodeComponent.children) { if (EntityUtils.getType(entity) == EntityFactory.COMPOSITE_TYPE) { addTreeRoot(item, node); } else { @@ -139,10 +138,10 @@ public class UIItemsTreeBox extends UICollapsibleBox { return node; } - private UIItemsTreeNode addTreeNode(Entity item, UIItemsTreeNode parentNode) { + private UIItemsTreeNode addTreeNode(int item, UIItemsTreeNode parentNode) { String name, style; - ParentNodeComponent parentNodeComponent = ComponentRetriever.get(item, ParentNodeComponent.class); - MainItemComponent mainItemComponent = ComponentRetriever.get(item, MainItemComponent.class); + ParentNodeComponent parentNodeComponent = SandboxComponentRetriever.get(item, ParentNodeComponent.class); + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(item, MainItemComponent.class); if (parentNodeComponent == null) { name = Sandbox.getInstance().sceneControl.getCurrentSceneVO().sceneName; @@ -161,7 +160,7 @@ public class UIItemsTreeBox extends UICollapsibleBox { VisTable label = new VisTable(); Cell lblCell = label.add(new VisLabel(name, style)); UIItemsTreeNode node = new UIItemsTreeNode(label); - ZIndexComponent zIndexComponent = ComponentRetriever.get(item, ZIndexComponent.class); + ZIndexComponent zIndexComponent = SandboxComponentRetriever.get(item, ZIndexComponent.class); node.setValue(new UIItemsTreeValue(mainItemComponent.uniqueId, zIndexComponent.getGlobalZIndex())); if (mainItemComponent.entityType != EntityFactory.COMPOSITE_TYPE) @@ -180,7 +179,7 @@ public class UIItemsTreeBox extends UICollapsibleBox { return node; } - public void setSelection(Set selection) { + public void setSelection(Set selection) { lastSelection = selection; if (tree == null) return; @@ -189,7 +188,7 @@ public class UIItemsTreeBox extends UICollapsibleBox { addToSelection(selection); } - public void addToSelection(Set selection) { + public void addToSelection(Set selection) { if (lastSelection != null && selection != null) lastSelection.addAll(selection); @@ -206,7 +205,7 @@ public class UIItemsTreeBox extends UICollapsibleBox { } } - public void removeFromSelection(Set selection) { + public void removeFromSelection(Set selection) { if (lastSelection != null && selection != null) lastSelection.removeAll(selection); @@ -231,7 +230,7 @@ public class UIItemsTreeBox extends UICollapsibleBox { facade.sendNotification(ITEMS_SELECTED, selection); if (selection.size() == 1 && getTapCount() == 2) { UIItemsTreeValue selected = selection.first().getValue(); - Entity item = EntityUtils.getByUniqueId(selected.entityId); + int item = EntityUtils.getByUniqueId(selected.entityId); if (EntityUtils.getType(item) == EntityFactory.COMPOSITE_TYPE) { HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ACTION_CAMERA_CHANGE_COMPOSITE, item); } diff --git a/src/main/java/games/rednblack/editor/view/ui/box/UIItemsTreeBoxMediator.java b/src/main/java/games/rednblack/editor/view/ui/box/UIItemsTreeBoxMediator.java index 61a47509..e2d1ee91 100644 --- a/src/main/java/games/rednblack/editor/view/ui/box/UIItemsTreeBoxMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/box/UIItemsTreeBoxMediator.java @@ -1,6 +1,5 @@ package games.rednblack.editor.view.ui.box; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.scenes.scene2d.utils.Selection; import com.badlogic.gdx.utils.Array; import games.rednblack.editor.controller.commands.resource.DeleteResourceCommand; @@ -53,7 +52,7 @@ public class UIItemsTreeBoxMediator extends PanelMediator { Sandbox sandbox = Sandbox.getInstance(); switch (notification.getName()) { case MsgAPI.SCENE_LOADED: - Entity rootEntity = sandbox.getCurrentViewingEntity(); + int rootEntity = sandbox.getCurrentViewingEntity(); viewComponent.init(rootEntity); break; case MsgAPI.ACTION_CAMERA_CHANGE_COMPOSITE: @@ -71,17 +70,17 @@ public class UIItemsTreeBoxMediator extends PanelMediator { case UIItemsTreeBox.ITEMS_SELECTED: Selection selection = notification.getBody(); Array nodes = selection.toArray(); - Set items = new HashSet<>(); + Set items = new HashSet<>(); for (UIItemsTreeNode node : nodes) { Integer entityId = node.getValue().entityId; - Entity item = EntityUtils.getByUniqueId(entityId); + int item = EntityUtils.getByUniqueId(entityId); //layer lock thing LayerItemVO layerItemVO = EntityUtils.getEntityLayer(item); if(layerItemVO != null && layerItemVO.isLocked) { continue; } - if (item != null) { + if (item != -1) { items.add(item); } } @@ -97,8 +96,8 @@ public class UIItemsTreeBoxMediator extends PanelMediator { } } - private void sendSelectionNotification(Set items) { - Set ntfItems = (items.isEmpty())? null : items; + private void sendSelectionNotification(Set items) { + Set ntfItems = (items.isEmpty())? null : items; HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ACTION_SET_SELECTION, ntfItems); } } \ No newline at end of file diff --git a/src/main/java/games/rednblack/editor/view/ui/box/UILayerBoxMediator.java b/src/main/java/games/rednblack/editor/view/ui/box/UILayerBoxMediator.java index d5fabba6..fc60911c 100644 --- a/src/main/java/games/rednblack/editor/view/ui/box/UILayerBoxMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/box/UILayerBoxMediator.java @@ -18,7 +18,7 @@ package games.rednblack.editor.view.ui.box; -import com.badlogic.ashley.core.Entity; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import com.kotcrab.vis.ui.util.dialog.Dialogs; import com.kotcrab.vis.ui.util.dialog.InputDialogListener; @@ -174,9 +174,9 @@ public class UILayerBoxMediator extends PanelMediator { setEntityVisibilityByLayer(layerItem, true); break; case MsgAPI.ITEM_SELECTION_CHANGED: - Set selection = notification.getBody(); + Set selection = notification.getBody(); if(selection.size() == 1) { - ZIndexComponent zIndexComponent = ComponentRetriever.get(selection.iterator().next(), ZIndexComponent.class); + ZIndexComponent zIndexComponent = SandboxComponentRetriever.get(selection.iterator().next(), ZIndexComponent.class); index = findLayerByName(zIndexComponent.layerName); if(index == -1) { // handle this somehow @@ -190,8 +190,8 @@ public class UILayerBoxMediator extends PanelMediator { break; case MsgAPI.NEW_ITEM_ADDED: index = viewComponent.getCurrentSelectedLayerIndex(); - Entity item = notification.getBody(); - ZIndexComponent zIndexComponent = ComponentRetriever.get(item, ZIndexComponent.class); + int item = notification.getBody(); + ZIndexComponent zIndexComponent = SandboxComponentRetriever.get(item, ZIndexComponent.class); if(zIndexComponent.layerName == null) zIndexComponent.layerName = layers.get(index).layerName; break; case UILayerBox.CHANGE_LAYER_NAME: @@ -238,7 +238,7 @@ public class UILayerBoxMediator extends PanelMediator { }*/ private void addNewLayerToItemComposite(LayerItemVO layerVo) { - LayerMapComponent layerMapComponent = ComponentRetriever.get(Sandbox.getInstance().getCurrentViewingEntity(), LayerMapComponent.class); + LayerMapComponent layerMapComponent = SandboxComponentRetriever.get(Sandbox.getInstance().getCurrentViewingEntity(), LayerMapComponent.class); layerMapComponent.addLayer(layerVo); } @@ -247,8 +247,8 @@ public class UILayerBoxMediator extends PanelMediator { if(setLocked){ Sandbox.getInstance().getSelector().clearSelections(); } - Entity viewEntity = Sandbox.getInstance().getCurrentViewingEntity(); - LayerMapComponent layerMapComponent = ComponentRetriever.get(viewEntity, LayerMapComponent.class); + int viewEntity = Sandbox.getInstance().getCurrentViewingEntity(); + LayerMapComponent layerMapComponent = SandboxComponentRetriever.get(viewEntity, LayerMapComponent.class); layerMapComponent.getLayer(layerName).isLocked = setLocked; } @@ -260,13 +260,13 @@ public class UILayerBoxMediator extends PanelMediator { return; } String layerName = layerItem.getLayerName(); - Entity viewEntity = Sandbox.getInstance().getCurrentViewingEntity(); + int viewEntity = Sandbox.getInstance().getCurrentViewingEntity(); - NodeComponent nodeComponent = ComponentRetriever.get(viewEntity, NodeComponent.class); - Set items = new HashSet<>(); + NodeComponent nodeComponent = SandboxComponentRetriever.get(viewEntity, NodeComponent.class); + Set items = new HashSet<>(); for(int i=0; i { private void setEntityVisibilityByLayer(UILayerBox.UILayerItem layerItem, boolean setVisible) { String layerName = layerItem.getLayerName(); - Entity viewEntity = Sandbox.getInstance().getCurrentViewingEntity(); + int viewEntity = Sandbox.getInstance().getCurrentViewingEntity(); - NodeComponent nodeComponent = ComponentRetriever.get(viewEntity, NodeComponent.class); + NodeComponent nodeComponent = SandboxComponentRetriever.get(viewEntity, NodeComponent.class); for(int i=0; i { } private void initLayerData() { - - Entity viewEntity = Sandbox.getInstance().getCurrentViewingEntity(); - LayerMapComponent layerMapComponent = ComponentRetriever.get(viewEntity, LayerMapComponent.class); + int viewEntity = Sandbox.getInstance().getCurrentViewingEntity(); + LayerMapComponent layerMapComponent = SandboxComponentRetriever.get(viewEntity, LayerMapComponent.class); layers = layerMapComponent.getLayers(); viewComponent.clearItems(); diff --git a/src/main/java/games/rednblack/editor/view/ui/box/UIMultiPropertyBoxMediator.java b/src/main/java/games/rednblack/editor/view/ui/box/UIMultiPropertyBoxMediator.java index 4f259e16..73c98a15 100644 --- a/src/main/java/games/rednblack/editor/view/ui/box/UIMultiPropertyBoxMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/box/UIMultiPropertyBoxMediator.java @@ -23,10 +23,11 @@ import java.util.HashMap; import java.util.Set; import java.util.stream.Stream; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; +import games.rednblack.editor.view.ui.properties.UIAbstractPropertiesMediator; import org.puremvc.java.interfaces.IMediator; import org.puremvc.java.interfaces.INotification; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.utils.reflect.ClassReflection; import com.badlogic.gdx.utils.reflect.ReflectionException; @@ -47,7 +48,6 @@ import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.editor.view.stage.SandboxMediator; import games.rednblack.editor.view.stage.tools.TextTool; import games.rednblack.editor.view.ui.properties.UIAbstractProperties; -import games.rednblack.editor.view.ui.properties.UIAbstractPropertiesMediator; import games.rednblack.editor.view.ui.properties.panels.UIBasicItemPropertiesMediator; import games.rednblack.editor.view.ui.properties.panels.UICompositeItemPropertiesMediator; import games.rednblack.editor.view.ui.properties.panels.UIImageItemPropertiesMediator; @@ -90,9 +90,8 @@ public class UIMultiPropertyBoxMediator extends PanelMediator(); - //TODO this is very bad, but PooledEngine$PooledEntity is private :( - classToMediatorMap.put("com.badlogic.ashley.core.PooledEngine$PooledEntity", new ArrayList<>()); - classToMediatorMap.get("com.badlogic.ashley.core.PooledEngine$PooledEntity").add(UIBasicItemPropertiesMediator.NAME); + classToMediatorMap.put(Integer.class.getName(), new ArrayList<>()); + classToMediatorMap.get(Integer.class.getName()).add(UIBasicItemPropertiesMediator.NAME); classToMediatorMap.put(SceneVO.class.getName(), new ArrayList<>()); classToMediatorMap.get(SceneVO.class.getName()).add(UIScenePropertiesMediator.NAME); @@ -126,7 +125,7 @@ public class UIMultiPropertyBoxMediator extends PanelMediator selection = notification.getBody(); + Set selection = notification.getBody(); if (selection.size() == 1) { initAllPropertyBoxes(selection.iterator().next()); } else if (selection.size() > 1) { @@ -157,8 +156,8 @@ public class UIMultiPropertyBoxMediator extends PanelMediator mediatorNames = new ArrayList<>(classToMediatorMap.get(mapName)); // TODO: this is not uber cool, gotta think a new way to make this class know nothing about entities - if (observable instanceof Entity) { - initEntityProperties(mediatorNames, (Entity) observable); + if (observable instanceof Integer) { + initEntityProperties(mediatorNames, (int) observable); } clearPropertyBoxes(); @@ -177,7 +176,7 @@ public class UIMultiPropertyBoxMediator extends PanelMediator mediatorNames, Entity entity) { + private void initEntityProperties(ArrayList mediatorNames, int entity) { int entityType = EntityUtils.getType(entity); if (entityType == EntityFactory.IMAGE_TYPE) { @@ -207,12 +206,12 @@ public class UIMultiPropertyBoxMediator extends PanelMediator selection) { + private void initMultipleSelectionPropertyBox(Set selection) { clearPropertyBoxes(); UIMultipleSelectPropertiesMediator mediator = new UIMultipleSelectPropertiesMediator(); facade.registerMediator(mediator); diff --git a/src/main/java/games/rednblack/editor/view/ui/dialog/AutoTraceDialogMediator.java b/src/main/java/games/rednblack/editor/view/ui/dialog/AutoTraceDialogMediator.java index 952dc254..040fa7a0 100644 --- a/src/main/java/games/rednblack/editor/view/ui/dialog/AutoTraceDialogMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/dialog/AutoTraceDialogMediator.java @@ -1,13 +1,14 @@ package games.rednblack.editor.view.ui.dialog; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.math.Vector2; import com.kotcrab.vis.ui.util.dialog.Dialogs; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.renderer.components.PolygonComponent; import games.rednblack.editor.renderer.components.TextureRegionComponent; +import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.utils.poly.PolygonUtils; import games.rednblack.editor.utils.poly.tracer.Tracer; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.editor.view.stage.UIStage; import games.rednblack.h2d.common.MsgAPI; @@ -21,7 +22,7 @@ public class AutoTraceDialogMediator extends Mediator { private static final String TAG = AutoTraceDialogMediator.class.getCanonicalName(); private static final String NAME = TAG; - private Entity entity; + private int entity; public AutoTraceDialogMediator() { super(NAME, new AutoTraceDialog()); @@ -59,10 +60,10 @@ public class AutoTraceDialogMediator extends Mediator { } private void addAutoTraceMesh() { - PolygonComponent polygonComponent = entity.getComponent(PolygonComponent.class); + PolygonComponent polygonComponent = SandboxComponentRetriever.get(entity, PolygonComponent.class); if (polygonComponent != null) { - TextureRegionComponent textureRegionComponent = entity.getComponent(TextureRegionComponent.class); + TextureRegionComponent textureRegionComponent = SandboxComponentRetriever.get(entity, TextureRegionComponent.class); if (textureRegionComponent != null && textureRegionComponent.region != null && !textureRegionComponent.regionName.equals("")) { polygonComponent.vertices = Tracer.trace(textureRegionComponent.region, viewComponent.getHullTolerance(), diff --git a/src/main/java/games/rednblack/editor/view/ui/followers/BasicFollower.java b/src/main/java/games/rednblack/editor/view/ui/followers/BasicFollower.java index f583d6ed..e001ec3e 100644 --- a/src/main/java/games/rednblack/editor/view/ui/followers/BasicFollower.java +++ b/src/main/java/games/rednblack/editor/view/ui/followers/BasicFollower.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view.ui.followers; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector2; @@ -27,6 +26,7 @@ import com.badlogic.gdx.scenes.scene2d.Group; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Pools; import games.rednblack.editor.renderer.components.MainItemComponent; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.editor.renderer.components.DimensionsComponent; import games.rednblack.editor.renderer.components.TransformComponent; @@ -41,7 +41,7 @@ public abstract class BasicFollower extends Group { protected TransformComponent transformComponent; protected DimensionsComponent dimensionsComponent; - protected Entity entity; + protected int entity; protected float pointOriginX; protected float pointOriginY; @@ -51,20 +51,20 @@ public abstract class BasicFollower extends Group { private final Array subFollowers = new Array<>(); - public BasicFollower(Entity entity) { + public BasicFollower(int entity) { setItem(entity); create(); update(); } - private void setItem(Entity entity) { - transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + private void setItem(int entity) { + transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); this.entity = entity; } public void update() { - if (ComponentRetriever.get(entity, MainItemComponent.class) == null) + if (SandboxComponentRetriever.get(entity, MainItemComponent.class) == null) return; Sandbox sandbox = Sandbox.getInstance(); @@ -77,7 +77,7 @@ public abstract class BasicFollower extends Group { position.x = 0; position.y = 0; - TransformMathUtils.localToAscendantCoordinates(sandbox.getCurrentViewingEntity(), entity, position); + TransformMathUtils.localToAscendantCoordinates(sandbox.getCurrentViewingEntity(), entity, position, sandbox.getEngine()); position = Sandbox.getInstance().worldToScreen(position); setX( ( int ) ( position.x ) ); @@ -164,7 +164,7 @@ public abstract class BasicFollower extends Group { } } - public Entity getEntity() { + public int getEntity() { return entity; } diff --git a/src/main/java/games/rednblack/editor/view/ui/followers/FollowerFactory.java b/src/main/java/games/rednblack/editor/view/ui/followers/FollowerFactory.java index 3c402daf..2e21508a 100644 --- a/src/main/java/games/rednblack/editor/view/ui/followers/FollowerFactory.java +++ b/src/main/java/games/rednblack/editor/view/ui/followers/FollowerFactory.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view.ui.followers; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.renderer.factory.EntityFactory; import games.rednblack.editor.utils.runtime.EntityUtils; @@ -27,7 +26,7 @@ import games.rednblack.editor.utils.runtime.EntityUtils; */ public class FollowerFactory { - public static BasicFollower createFollower(Entity entity) { + public static BasicFollower createFollower(int entity) { switch (EntityUtils.getType(entity)) { case EntityFactory.IMAGE_TYPE: return new ImageFollower(entity); diff --git a/src/main/java/games/rednblack/editor/view/ui/followers/ImageFollower.java b/src/main/java/games/rednblack/editor/view/ui/followers/ImageFollower.java index e5cf2467..c96fd623 100644 --- a/src/main/java/games/rednblack/editor/view/ui/followers/ImageFollower.java +++ b/src/main/java/games/rednblack/editor/view/ui/followers/ImageFollower.java @@ -1,6 +1,5 @@ package games.rednblack.editor.view.ui.followers; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.renderer.components.TextureRegionComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; @@ -9,7 +8,7 @@ import games.rednblack.editor.renderer.utils.ComponentRetriever; */ public class ImageFollower extends NormalSelectionFollower { - public ImageFollower(Entity entity) { + public ImageFollower(int entity) { super(entity); } diff --git a/src/main/java/games/rednblack/editor/view/ui/followers/LightFollower.java b/src/main/java/games/rednblack/editor/view/ui/followers/LightFollower.java index be9048b1..74de451d 100644 --- a/src/main/java/games/rednblack/editor/view/ui/followers/LightFollower.java +++ b/src/main/java/games/rednblack/editor/view/ui/followers/LightFollower.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view.ui.followers; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.Color; @@ -35,7 +34,7 @@ public class LightFollower extends BasicFollower { private Image icon; - public LightFollower(Entity entity) { + public LightFollower(int entity) { super(entity); } diff --git a/src/main/java/games/rednblack/editor/view/ui/followers/NormalSelectionFollower.java b/src/main/java/games/rednblack/editor/view/ui/followers/NormalSelectionFollower.java index b24cf42b..940bab3a 100644 --- a/src/main/java/games/rednblack/editor/view/ui/followers/NormalSelectionFollower.java +++ b/src/main/java/games/rednblack/editor/view/ui/followers/NormalSelectionFollower.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view.ui.followers; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Group; import com.badlogic.gdx.scenes.scene2d.InputEvent; @@ -62,7 +61,7 @@ public class NormalSelectionFollower extends BasicFollower { } protected SelectionMode mode = SelectionMode.normal; - public NormalSelectionFollower(Entity entity) { + public NormalSelectionFollower(int entity) { super(entity); } diff --git a/src/main/java/games/rednblack/editor/view/ui/followers/ParticleFollower.java b/src/main/java/games/rednblack/editor/view/ui/followers/ParticleFollower.java index 33c19bb9..52328d4f 100644 --- a/src/main/java/games/rednblack/editor/view/ui/followers/ParticleFollower.java +++ b/src/main/java/games/rednblack/editor/view/ui/followers/ParticleFollower.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view.ui.followers; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.scenes.scene2d.Touchable; import com.badlogic.gdx.scenes.scene2d.ui.Image; @@ -32,7 +31,7 @@ public class ParticleFollower extends BasicFollower { private Image icon; - public ParticleFollower(Entity entity) { + public ParticleFollower(int entity) { super(entity); setTransform(false); } diff --git a/src/main/java/games/rednblack/editor/view/ui/followers/PolygonFollower.java b/src/main/java/games/rednblack/editor/view/ui/followers/PolygonFollower.java index aac1058d..1435d03b 100644 --- a/src/main/java/games/rednblack/editor/view/ui/followers/PolygonFollower.java +++ b/src/main/java/games/rednblack/editor/view/ui/followers/PolygonFollower.java @@ -18,7 +18,6 @@ package games.rednblack.editor.view.ui.followers; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.Color; @@ -36,6 +35,7 @@ import games.rednblack.editor.renderer.components.PolygonComponent; import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.utils.PolygonUtils; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; import java.util.ArrayList; @@ -72,7 +72,7 @@ public class PolygonFollower extends SubFollower { private final int pixelsPerWU; private final OrthographicCamera runtimeCamera = Sandbox.getInstance().getCamera(); - public PolygonFollower(Entity entity) { + public PolygonFollower(int entity) { super(entity); pixelsPerWU = Sandbox.getInstance().getPixelPerWU(); setTouchable(Touchable.enabled); @@ -80,8 +80,8 @@ public class PolygonFollower extends SubFollower { } public void create() { - polygonComponent = ComponentRetriever.get(entity, PolygonComponent.class); - transformComponent = ComponentRetriever.get(entity, TransformComponent.class); + polygonComponent = SandboxComponentRetriever.get(entity, PolygonComponent.class); + transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); shapeRenderer = new ShapeRenderer(); } @@ -366,7 +366,7 @@ public class PolygonFollower extends SubFollower { return -1; } - public Entity getEntity() { + public int getEntity() { return entity; } diff --git a/src/main/java/games/rednblack/editor/view/ui/followers/PolygonFollower2.java b/src/main/java/games/rednblack/editor/view/ui/followers/PolygonFollower2.java index 00ca12b3..2e72d052 100644 --- a/src/main/java/games/rednblack/editor/view/ui/followers/PolygonFollower2.java +++ b/src/main/java/games/rednblack/editor/view/ui/followers/PolygonFollower2.java @@ -1,6 +1,5 @@ package games.rednblack.editor.view.ui.followers; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.OrthographicCamera; @@ -18,6 +17,7 @@ import games.rednblack.editor.renderer.components.PolygonComponent; import games.rednblack.editor.renderer.components.TransformComponent; import games.rednblack.editor.renderer.utils.ComponentRetriever; import games.rednblack.editor.renderer.utils.PolygonUtils; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.editor.view.ui.widget.actors.basic.WhitePixel; import games.rednblack.editor.view.ui.widget.actors.polygon.PolyLine; @@ -64,7 +64,7 @@ public class PolygonFollower2 extends SubFollower { } }; - public PolygonFollower2(Entity entity) { + public PolygonFollower2(int entity) { super(entity); setTouchable(Touchable.enabled); pixelsPerWU = Sandbox.getInstance().getPixelPerWU(); @@ -72,9 +72,9 @@ public class PolygonFollower2 extends SubFollower { @Override public void create() { - polygonComponent = ComponentRetriever.get(entity, PolygonComponent.class); - transformComponent = ComponentRetriever.get(entity, TransformComponent.class); - dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); + polygonComponent = SandboxComponentRetriever.get(entity, PolygonComponent.class); + transformComponent = SandboxComponentRetriever.get(entity, TransformComponent.class); + dimensionsComponent = SandboxComponentRetriever.get(entity, DimensionsComponent.class); } @Override @@ -204,7 +204,7 @@ public class PolygonFollower2 extends SubFollower { }); } - public Entity getEntity() { + public int getEntity() { return entity; } diff --git a/src/main/java/games/rednblack/editor/view/ui/followers/SpineFollower.java b/src/main/java/games/rednblack/editor/view/ui/followers/SpineFollower.java index 637fde36..0cbef8ec 100644 --- a/src/main/java/games/rednblack/editor/view/ui/followers/SpineFollower.java +++ b/src/main/java/games/rednblack/editor/view/ui/followers/SpineFollower.java @@ -1,12 +1,12 @@ package games.rednblack.editor.view.ui.followers; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.math.Matrix4; import com.esotericsoftware.spine.SkeletonRendererDebug; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.h2d.extention.spine.SpineObjectComponent; @@ -16,9 +16,9 @@ public class SpineFollower extends NormalSelectionFollower { private final Matrix4 matrix = new Matrix4(); - public SpineFollower(Entity entity) { + public SpineFollower(int entity) { super(entity); - spineObjectComponent = ComponentRetriever.get(entity, SpineObjectComponent.class); + spineObjectComponent = SandboxComponentRetriever.get(entity, SpineObjectComponent.class); skeletonRendererDebug = new SkeletonRendererDebug(); skeletonRendererDebug.setScale(2f); skeletonRendererDebug.setBoundingBoxes(false); diff --git a/src/main/java/games/rednblack/editor/view/ui/followers/SubFollower.java b/src/main/java/games/rednblack/editor/view/ui/followers/SubFollower.java index ff5f50ba..4e4ecdf6 100644 --- a/src/main/java/games/rednblack/editor/view/ui/followers/SubFollower.java +++ b/src/main/java/games/rednblack/editor/view/ui/followers/SubFollower.java @@ -1,6 +1,5 @@ package games.rednblack.editor.view.ui.followers; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.scenes.scene2d.Group; import org.puremvc.java.interfaces.INotification; @@ -9,15 +8,15 @@ import org.puremvc.java.interfaces.INotification; */ public abstract class SubFollower extends Group { - protected Entity entity; + protected int entity; protected BasicFollower parentFollower; - public SubFollower(Entity entity) { + public SubFollower(int entity) { setItem(entity); create(); } - private void setItem(Entity entity) { + private void setItem(int entity) { this.entity = entity; } diff --git a/src/main/java/games/rednblack/editor/view/ui/panel/CustomVariablesPanelMediator.java b/src/main/java/games/rednblack/editor/view/ui/panel/CustomVariablesPanelMediator.java index 69b3bee5..9a272d9a 100644 --- a/src/main/java/games/rednblack/editor/view/ui/panel/CustomVariablesPanelMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/panel/CustomVariablesPanelMediator.java @@ -18,7 +18,7 @@ package games.rednblack.editor.view.ui.panel; -import com.badlogic.ashley.core.Entity; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.menu.WindowMenu; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; @@ -40,7 +40,7 @@ public class CustomVariablesPanelMediator extends Mediator private static final String TAG = CustomVariablesPanelMediator.class.getCanonicalName(); private static final String NAME = TAG; - private Entity observable = null; + private int observable = -1; public CustomVariablesPanelMediator() { super(NAME, new CustomVariablesPanel()); @@ -79,7 +79,7 @@ public class CustomVariablesPanelMediator extends Mediator viewComponent.show(uiStage); break; case MsgAPI.ITEM_SELECTION_CHANGED: - Set selection = notification.getBody(); + Set selection = notification.getBody(); if (selection.size() == 1) { setObservable(selection.iterator().next()); } else { @@ -87,7 +87,7 @@ public class CustomVariablesPanelMediator extends Mediator } break; case MsgAPI.EMPTY_SPACE_CLICKED: - setObservable(null); + setObservable(-1); break; case CustomVariablesPanel.ADD_BUTTON_PRESSED: setVariable(); @@ -112,7 +112,7 @@ public class CustomVariablesPanelMediator extends Mediator sendNotification(MsgAPI.CUSTOM_VARIABLE_MODIFY, CustomVariableModifyCommand.removeCustomVariable(observable, key)); } - private void setObservable(Entity item) { + private void setObservable(int item) { observable = item; updateView(); viewComponent.setKeyFieldValue(""); @@ -120,10 +120,10 @@ public class CustomVariablesPanelMediator extends Mediator } private void updateView() { - if (observable == null) { + if (observable == -1) { viewComponent.setEmptyMsg("No item selected."); } else { - MainItemComponent mainItemComponent = ComponentRetriever.get(observable, MainItemComponent.class); + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(observable, MainItemComponent.class); viewComponent.updateView(mainItemComponent.customVariables); } } diff --git a/src/main/java/games/rednblack/editor/view/ui/panel/EditSpriteAnimationPanelMediator.java b/src/main/java/games/rednblack/editor/view/ui/panel/EditSpriteAnimationPanelMediator.java index 9c7d353d..1b4f5a96 100644 --- a/src/main/java/games/rednblack/editor/view/ui/panel/EditSpriteAnimationPanelMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/panel/EditSpriteAnimationPanelMediator.java @@ -18,7 +18,7 @@ package games.rednblack.editor.view.ui.panel; -import com.badlogic.ashley.core.Entity; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.menu.WindowMenu; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; @@ -42,7 +42,7 @@ public class EditSpriteAnimationPanelMediator extends Mediator selection = notification.getBody(); + Set selection = notification.getBody(); if(selection.size() == 1) { - Entity entity = selection.iterator().next(); + int entity = selection.iterator().next(); if(EntityUtils.getType(entity) == EntityFactory.SPRITE_TYPE) { setObservable(entity); } else { - observable = null; + observable = -1; viewComponent.setEmpty("Selected item is not a sprite animation"); } } break; case MsgAPI.EMPTY_SPACE_CLICKED: - setObservable(null); + setObservable(-1); break; case EditSpriteAnimationPanel.ADD_BUTTON_PRESSED: addAnimation(); @@ -108,7 +108,7 @@ public class EditSpriteAnimationPanelMediator extends Mediator uniforms; - private HashMap customUniforms; + private ObjectMap uniforms; + private ObjectMap customUniforms; public ShaderUniformsPanel() { super("Shader Uniforms"); @@ -86,13 +84,13 @@ public class ShaderUniformsPanel extends UIDraggablePanel { pack(); } - public void updateView(HashMap uniforms, HashMap customUniforms) { + public void updateView(ObjectMap uniforms, ObjectMap customUniforms) { clearInputs(); getContentTable().clear(); this.uniforms = uniforms; this.customUniforms = customUniforms; - uniformName.setItems(uniforms.keySet().toArray(String[]::new)); + uniformName.setItems(uniforms.keys().toArray()); getContentTable().add(addUniformTable).growX().row(); hSeparator(getContentTable()); @@ -250,11 +248,11 @@ public class ShaderUniformsPanel extends UIDraggablePanel { uniformsTable.add(); uniformsTable.add().row(); - for (Map.Entry me : customUniforms.entrySet()) { - removeUniformFromList(me.getKey()); + for (String key : customUniforms.keys()) { + removeUniformFromList(key); - uniformsTable.add(new CellBody(me.getKey())); - ShaderUniformVO uniformVO = me.getValue(); + uniformsTable.add(new CellBody(key)); + ShaderUniformVO uniformVO = customUniforms.get(key); uniformsTable.add(new CellBody(uniformVO.getType())); @@ -285,8 +283,8 @@ public class ShaderUniformsPanel extends UIDraggablePanel { VisTable editTable = new VisTable(); LinkLabel editLabel = new LinkLabel("Edit"); editLabel.setListener(url -> { - addUniformFromList(me.getKey()); - uniformName.setSelected(me.getKey()); + addUniformFromList(key); + uniformName.setSelected(key); uniformName.setDisabled(true); editUniform(uniformVO); @@ -295,7 +293,7 @@ public class ShaderUniformsPanel extends UIDraggablePanel { editTable.add("/").padLeft(2).padRight(2); LinkLabel deleteLabel = new LinkLabel("Delete"); deleteLabel.setListener(url -> { - facade.sendNotification(REMOVE_BUTTON_CLICKED, me.getKey()); + facade.sendNotification(REMOVE_BUTTON_CLICKED, key); }); editTable.add(deleteLabel); uniformsTable.add(new CellBody(editTable)); diff --git a/src/main/java/games/rednblack/editor/view/ui/panel/ShaderUniformsPanelMediator.java b/src/main/java/games/rednblack/editor/view/ui/panel/ShaderUniformsPanelMediator.java index 72031dd3..bfe85f3d 100644 --- a/src/main/java/games/rednblack/editor/view/ui/panel/ShaderUniformsPanelMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/panel/ShaderUniformsPanelMediator.java @@ -1,10 +1,10 @@ package games.rednblack.editor.view.ui.panel; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.renderer.components.ShaderComponent; import games.rednblack.editor.renderer.data.ShaderUniformVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.menu.WindowMenu; import games.rednblack.editor.view.stage.Sandbox; import games.rednblack.editor.view.stage.UIStage; @@ -19,7 +19,7 @@ public class ShaderUniformsPanelMediator extends Mediator { private static final String TAG = ShaderUniformsPanelMediator.class.getCanonicalName(); private static final String NAME = TAG; - private Entity observable = null; + private int observable = -1; public ShaderUniformsPanelMediator() { super(NAME, new ShaderUniformsPanel()); @@ -58,16 +58,16 @@ public class ShaderUniformsPanelMediator extends Mediator { viewComponent.show(uiStage); break; case MsgAPI.ITEM_SELECTION_CHANGED: - Set selection = notification.getBody(); + Set selection = notification.getBody(); if (selection.size() == 1) { - Entity entity = selection.iterator().next(); + int entity = selection.iterator().next(); setObservable(entity); } else { - setObservable(null); + setObservable(-1); } break; case MsgAPI.EMPTY_SPACE_CLICKED: - setObservable(null); + setObservable(-1); break; case ShaderUniformsPanel.ADD_BUTTON_CLICKED: addNewUniform(notification.getBody()); @@ -78,18 +78,18 @@ public class ShaderUniformsPanelMediator extends Mediator { } } - private void setObservable(Entity item) { + private void setObservable(int item) { observable = item; updateView(); } private void updateView() { - if (observable == null) { + if (observable == -1) { viewComponent.setEmpty(); return; } - ShaderComponent shaderComponent = ComponentRetriever.get(observable, ShaderComponent.class); + ShaderComponent shaderComponent = SandboxComponentRetriever.get(observable, ShaderComponent.class); if (shaderComponent != null) viewComponent.updateView(shaderComponent.uniforms, shaderComponent.customUniforms); else @@ -117,14 +117,14 @@ public class ShaderUniformsPanelMediator extends Mediator { break; } - ShaderComponent shaderComponent = ComponentRetriever.get(observable, ShaderComponent.class); + ShaderComponent shaderComponent = SandboxComponentRetriever.get(observable, ShaderComponent.class); shaderComponent.customUniforms.put(name, vo); updateView(); } private void removeUniform(String uniform) { - ShaderComponent shaderComponent = ComponentRetriever.get(observable, ShaderComponent.class); + ShaderComponent shaderComponent = SandboxComponentRetriever.get(observable, ShaderComponent.class); shaderComponent.customUniforms.remove(uniform); updateView(); diff --git a/src/main/java/games/rednblack/editor/view/ui/panel/TagsPanelMediator.java b/src/main/java/games/rednblack/editor/view/ui/panel/TagsPanelMediator.java index 9d1645cb..6fc88f81 100644 --- a/src/main/java/games/rednblack/editor/view/ui/panel/TagsPanelMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/panel/TagsPanelMediator.java @@ -1,6 +1,6 @@ package games.rednblack.editor.view.ui.panel; -import com.badlogic.ashley.core.Entity; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.menu.WindowMenu; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; @@ -24,7 +24,7 @@ public class TagsPanelMediator extends Mediator { private static final String TAG = TagsPanelMediator.class.getCanonicalName(); private static final String NAME = TAG; - private final Set observables = new HashSet<>(); + private final Set observables = new HashSet<>(); public TagsPanelMediator() { super(NAME, new TagsPanel()); @@ -62,7 +62,7 @@ public class TagsPanelMediator extends Mediator { viewComponent.show(uiStage); break; case MsgAPI.ITEM_SELECTION_CHANGED: - Set selection = notification.getBody(); + Set selection = notification.getBody(); setObservable(selection); break; case MsgAPI.EMPTY_SPACE_CLICKED: @@ -71,23 +71,23 @@ public class TagsPanelMediator extends Mediator { case TagsPanel.ITEM_REMOVED: viewComponent.updateView(); String tagToRemove = notification.getBody(); - for (Entity observable : observables) { - MainItemComponent mainItemComponent = observable.getComponent(MainItemComponent.class); + for (int observable : observables) { + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(observable, MainItemComponent.class); mainItemComponent.tags.remove(tagToRemove); } break; case TagsPanel.ITEM_ADD: viewComponent.updateView(); String tagToAdd = notification.getBody(); - for (Entity observable : observables) { - MainItemComponent mainItemComponent = observable.getComponent(MainItemComponent.class); + for (int observable : observables) { + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(observable, MainItemComponent.class); mainItemComponent.tags.add(tagToAdd); } break; } } - private void setObservable(Set items) { + private void setObservable(Set items) { observables.clear(); if (items != null) observables.addAll(items); @@ -98,10 +98,10 @@ public class TagsPanelMediator extends Mediator { if(observables.size() == 0) { viewComponent.setEmpty(); } else { - Iterator iterator = observables.iterator(); + Iterator iterator = observables.iterator(); - Entity entity = iterator.next(); - MainItemComponent mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + int entity = iterator.next(); + MainItemComponent mainItemComponent = SandboxComponentRetriever.get(entity, MainItemComponent.class); if (mainItemComponent == null) return; Set common = new LinkedHashSet<>(); @@ -112,7 +112,7 @@ public class TagsPanelMediator extends Mediator { while (iterator.hasNext()) { entity = iterator.next(); - mainItemComponent = ComponentRetriever.get(entity, MainItemComponent.class); + mainItemComponent = SandboxComponentRetriever.get(entity, MainItemComponent.class); toRetain.clear(); for (String tag : mainItemComponent.tags) toRetain.add(tag); diff --git a/src/main/java/games/rednblack/editor/view/ui/properties/UIAbstractEntityPropertiesMediator.java b/src/main/java/games/rednblack/editor/view/ui/properties/UIAbstractEntityPropertiesMediator.java new file mode 100644 index 00000000..ee73d041 --- /dev/null +++ b/src/main/java/games/rednblack/editor/view/ui/properties/UIAbstractEntityPropertiesMediator.java @@ -0,0 +1,104 @@ +/* + * ****************************************************************************** + * * Copyright 2015 See AUTHORS file. + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * ***************************************************************************** + */ + +package games.rednblack.editor.view.ui.properties; + +import games.rednblack.h2d.common.MsgAPI; +import games.rednblack.editor.HyperLap2DFacade; +import games.rednblack.editor.view.stage.Sandbox; +import org.puremvc.java.interfaces.INotification; +import org.puremvc.java.patterns.mediator.Mediator; + +/** + * Created by azakhary on 4/15/2015. + */ +public abstract class UIAbstractEntityPropertiesMediator extends UIAbstractPropertiesMediator { + protected Sandbox sandbox; + + protected int observableReference; + + protected boolean lockUpdates = true; + + public UIAbstractEntityPropertiesMediator(String mediatorName, V viewComponent) { + super(mediatorName, viewComponent); + + sandbox = Sandbox.getInstance(); + facade = HyperLap2DFacade.getInstance(); + } + + @Override + public void onRegister() { + facade = HyperLap2DFacade.getInstance(); + } + + + @Override + public String[] listNotificationInterests() { + return new String[]{ + MsgAPI.ITEM_DATA_UPDATED, + viewComponent.getUpdateEventName() + }; + } + + @Override + public void handleNotification(INotification notification) { + super.handleNotification(notification); + + + if(notification.getName().equals(viewComponent.getUpdateEventName())) { + if(!lockUpdates) { + translateViewToItemData(); + } + } + + switch (notification.getName()) { + case MsgAPI.ITEM_DATA_UPDATED: + onItemDataUpdate(); + break; + default: + break; + } + } + + @Override + public void setItem(Integer item) { + setItem((int) item); + } + + public void setItem(int item) { + observableReference = item; + lockUpdates = true; + translateObservableDataToView(observableReference); + lockUpdates = false; + } + + public void onItemDataUpdate() { + lockUpdates = true; + translateObservableDataToView(observableReference); + lockUpdates = false; + } + + @Override + protected void translateObservableDataToView(Integer item) { + translateObservableDataToView((int) item); + } + + protected abstract void translateObservableDataToView(int item); + + protected abstract void translateViewToItemData(); +} diff --git a/src/main/java/games/rednblack/editor/view/ui/properties/UIAbstractPropertiesMediator.java b/src/main/java/games/rednblack/editor/view/ui/properties/UIAbstractPropertiesMediator.java index 041b27c4..6958d839 100644 --- a/src/main/java/games/rednblack/editor/view/ui/properties/UIAbstractPropertiesMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/properties/UIAbstractPropertiesMediator.java @@ -1,32 +1,11 @@ -/* - * ****************************************************************************** - * * Copyright 2015 See AUTHORS file. - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * ***************************************************************************** - */ - package games.rednblack.editor.view.ui.properties; -import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.view.stage.Sandbox; +import games.rednblack.h2d.common.MsgAPI; import org.puremvc.java.interfaces.INotification; import org.puremvc.java.patterns.mediator.Mediator; -/** - * Created by azakhary on 4/15/2015. - */ public abstract class UIAbstractPropertiesMediator extends Mediator { private Sandbox sandbox; @@ -91,4 +70,4 @@ public abstract class UIAbstractPropertiesMediator extends UIAbstractPropertiesMediator { +public abstract class UIItemPropertiesMediator extends UIAbstractEntityPropertiesMediator { public UIItemPropertiesMediator(String mediatorName, V viewComponent) { super(mediatorName, viewComponent); @@ -48,7 +47,7 @@ public abstract class UIItemPropertiesMediator { +public class UIBasicItemPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UIBasicItemPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -114,7 +114,7 @@ public class UIBasicItemPropertiesMediator extends UIItemPropertiesMediator componentClass = componentClassMap.get(viewComponent.getSelectedComponent()); - if(componentClass == null) break; - Component component = ClassReflection.newInstance(componentClass); - facade.sendNotification(MsgAPI.ACTION_ADD_COMPONENT, AddComponentToItemCommand.payload(observableReference, component)); - } catch (ReflectionException ignored) {} + Class componentClass = componentClassMap.get(viewComponent.getSelectedComponent()); + if(componentClass == null) break; + facade.sendNotification(MsgAPI.ACTION_ADD_COMPONENT, AddComponentToItemCommand.payload(observableReference, componentClass)); break; default: break; @@ -161,7 +158,7 @@ public class UIBasicItemPropertiesMediator extends UIItemPropertiesMediator> entry : componentClassMap.entrySet()) { String componentName = entry.getKey(); Class componentClass = entry.getValue(); - Component component = entity.getComponent(componentClass); + Component component = SandboxComponentRetriever.get(entity, componentClass); if(component == null) { componentsToAddList.add(componentName); } @@ -230,12 +227,12 @@ public class UIBasicItemPropertiesMediator extends UIItemPropertiesMediator { +public class UICompositeItemPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UICompositeItemPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -45,16 +45,17 @@ public class UICompositeItemPropertiesMediator extends UIItemPropertiesMediator< } @Override - protected void translateObservableDataToView(Entity item) { - viewComponent.setAutomaticResize(item.getComponent(CompositeTransformComponent.class).automaticResize); - viewComponent.setScissorsEnabled(item.getComponent(CompositeTransformComponent.class).scissorsEnabled); - viewComponent.setRenderToFBOEnabled(item.getComponent(CompositeTransformComponent.class).renderToFBO); + protected void translateObservableDataToView(int item) { + CompositeTransformComponent transformComponent = SandboxComponentRetriever.get(item, CompositeTransformComponent.class); + viewComponent.setAutomaticResize(transformComponent.automaticResize); + viewComponent.setScissorsEnabled(transformComponent.scissorsEnabled); + viewComponent.setRenderToFBOEnabled(transformComponent.renderToFBO); } @Override protected void translateViewToItemData() { CompositeItemVO payloadVo = new CompositeItemVO(); - payloadVo.loadFromEntity(observableReference); + payloadVo.loadFromEntity(observableReference, sandbox.getEngine()); payloadVo.automaticResize = viewComponent.isAutomaticResizeIsEnabled(); payloadVo.scissorsEnabled = viewComponent.isScissorsEnabled(); @@ -65,10 +66,10 @@ public class UICompositeItemPropertiesMediator extends UIItemPropertiesMediator< CompositeSystem compositeSystem = Sandbox.getInstance().getEngine().getSystem(CompositeSystem.class); if (compositeSystem != null) { - compositeSystem.processEntity(observableReference, Gdx.graphics.getDeltaTime()); + compositeSystem.process(observableReference); } - Set entityHashSet = new HashSet<>(); + Set entityHashSet = new HashSet<>(); entityHashSet.add(observableReference); HyperLap2DFacade.getInstance().sendNotification(MsgAPI.ITEM_SELECTION_CHANGED, entityHashSet); } diff --git a/src/main/java/games/rednblack/editor/view/ui/properties/panels/UIImageItemPropertiesMediator.java b/src/main/java/games/rednblack/editor/view/ui/properties/panels/UIImageItemPropertiesMediator.java index c3b2fe22..05f042f4 100644 --- a/src/main/java/games/rednblack/editor/view/ui/properties/panels/UIImageItemPropertiesMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/properties/panels/UIImageItemPropertiesMediator.java @@ -1,14 +1,14 @@ package games.rednblack.editor.view.ui.properties.panels; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.controller.commands.component.UpdateImageItemDataCommand; import games.rednblack.editor.renderer.components.TextureRegionComponent; import games.rednblack.editor.renderer.data.SimpleImageVO; import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.ui.properties.UIItemPropertiesMediator; import games.rednblack.h2d.common.MsgAPI; -public class UIImageItemPropertiesMediator extends UIItemPropertiesMediator { +public class UIImageItemPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UIImageItemPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -19,8 +19,8 @@ public class UIImageItemPropertiesMediator extends UIItemPropertiesMediator { +public class UILabelItemPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UILabelItemPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -59,13 +59,13 @@ public class UILabelItemPropertiesMediator extends UIItemPropertiesMediator { +public class UILightBodyPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UILightBodyPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -53,7 +55,7 @@ public class UILightBodyPropertiesMediator extends UIItemPropertiesMediator { +public class UILightItemPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UILightItemPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -40,8 +40,8 @@ public class UILightItemPropertiesMediator extends UIItemPropertiesMediator, UIMultipleSelectProperties> { +public class UIMultipleSelectPropertiesMediator extends UIAbstractPropertiesMediator, UIMultipleSelectProperties> { private static final String TAG = UIMultipleSelectPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -30,7 +29,7 @@ public class UIMultipleSelectPropertiesMediator extends UIAbstractPropertiesMedi } @Override - protected void translateObservableDataToView(Set selection) { + protected void translateObservableDataToView(Set selection) { viewComponent.setSelectionCount(selection.size()); } diff --git a/src/main/java/games/rednblack/editor/view/ui/properties/panels/UIParticlePropertiesMediator.java b/src/main/java/games/rednblack/editor/view/ui/properties/panels/UIParticlePropertiesMediator.java index c7e167a1..9c8de1d4 100644 --- a/src/main/java/games/rednblack/editor/view/ui/properties/panels/UIParticlePropertiesMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/properties/panels/UIParticlePropertiesMediator.java @@ -1,13 +1,14 @@ package games.rednblack.editor.view.ui.properties.panels; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.controller.commands.component.UpdateParticleDataCommand; import games.rednblack.editor.renderer.components.particle.ParticleComponent; import games.rednblack.editor.renderer.data.ParticleEffectVO; +import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.ui.properties.UIItemPropertiesMediator; import games.rednblack.h2d.common.MsgAPI; -public class UIParticlePropertiesMediator extends UIItemPropertiesMediator { +public class UIParticlePropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UIParticlePropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -17,8 +18,8 @@ public class UIParticlePropertiesMediator extends UIItemPropertiesMediator { +public class UIPhysicsPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UIPhysicsPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -45,8 +46,8 @@ public class UIPhysicsPropertiesMediator extends UIItemPropertiesMediator { +public class UIPolygonComponentPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UIPolygonComponentPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -87,8 +87,8 @@ public class UIPolygonComponentPropertiesMediator extends UIItemPropertiesMediat } @Override - protected void translateObservableDataToView(Entity item) { - polygonComponent = item.getComponent(PolygonComponent.class); + protected void translateObservableDataToView(int item) { + polygonComponent = SandboxComponentRetriever.get(item, PolygonComponent.class); if(polygonComponent.vertices != null) { viewComponent.initView(); int verticesCount = 0; @@ -110,7 +110,7 @@ public class UIPolygonComponentPropertiesMediator extends UIItemPropertiesMediat } private void addDefaultMesh() { - DimensionsComponent dimensionsComponent = ComponentRetriever.get(observableReference, DimensionsComponent.class); + DimensionsComponent dimensionsComponent = SandboxComponentRetriever.get(observableReference, DimensionsComponent.class); if(dimensionsComponent.boundBox != null) { // If the bound box is not null we have a Composite Item! polygonComponent.makeRectangle( dimensionsComponent.boundBox.x, dimensionsComponent.boundBox.y, dimensionsComponent.boundBox.width, dimensionsComponent.boundBox.height); } @@ -127,7 +127,7 @@ public class UIPolygonComponentPropertiesMediator extends UIItemPropertiesMediat } private void copyMesh() { - polygonComponent = observableReference.getComponent(PolygonComponent.class); + polygonComponent = SandboxComponentRetriever.get(observableReference, PolygonComponent.class); Sandbox.getInstance().copyToLocalClipboard("meshData", polygonComponent.vertices); } diff --git a/src/main/java/games/rednblack/editor/view/ui/properties/panels/UIScenePropertiesMediator.java b/src/main/java/games/rednblack/editor/view/ui/properties/panels/UIScenePropertiesMediator.java index 8b916dd2..77fd547c 100644 --- a/src/main/java/games/rednblack/editor/view/ui/properties/panels/UIScenePropertiesMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/properties/panels/UIScenePropertiesMediator.java @@ -24,6 +24,7 @@ import games.rednblack.editor.controller.commands.UpdateSceneDataCommand; import games.rednblack.editor.proxy.ResolutionManager; import games.rednblack.editor.renderer.data.LightsPropertiesVO; import games.rednblack.editor.renderer.data.ResolutionEntryVO; +import games.rednblack.editor.view.ui.properties.UIAbstractPropertiesMediator; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.h2d.common.view.ui.widget.HyperLapColorPicker; import org.apache.commons.lang3.ArrayUtils; @@ -31,7 +32,6 @@ import org.apache.commons.lang3.math.NumberUtils; import com.badlogic.gdx.graphics.Color; import games.rednblack.editor.view.stage.Sandbox; -import games.rednblack.editor.view.ui.properties.UIAbstractPropertiesMediator; import games.rednblack.editor.renderer.data.PhysicsPropertiesVO; import games.rednblack.editor.renderer.data.SceneVO; import org.puremvc.java.interfaces.INotification; diff --git a/src/main/java/games/rednblack/editor/view/ui/properties/panels/UISensorPropertiesMediator.java b/src/main/java/games/rednblack/editor/view/ui/properties/panels/UISensorPropertiesMediator.java index da4f2f74..34bea7a2 100644 --- a/src/main/java/games/rednblack/editor/view/ui/properties/panels/UISensorPropertiesMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/properties/panels/UISensorPropertiesMediator.java @@ -1,11 +1,11 @@ package games.rednblack.editor.view.ui.properties.panels; +import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.math.NumberUtils; import org.puremvc.java.interfaces.INotification; -import com.badlogic.ashley.core.Entity; - import games.rednblack.editor.HyperLap2DFacade; import games.rednblack.editor.controller.commands.RemoveComponentFromItemCommand; import games.rednblack.editor.controller.commands.component.UpdateSensorDataCommand; @@ -19,7 +19,7 @@ import games.rednblack.h2d.common.MsgAPI; * * @author Jan-Thierry Wegener */ -public class UISensorPropertiesMediator extends UIItemPropertiesMediator { +public class UISensorPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UISensorPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -52,8 +52,8 @@ public class UISensorPropertiesMediator extends UIItemPropertiesMediator { +public class UIShaderPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UIShaderPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -101,8 +101,8 @@ public class UIShaderPropertiesMediator extends UIItemPropertiesMediator { +public class UISpineAnimationItemPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UISpineAnimationItemPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -41,9 +41,9 @@ public class UISpineAnimationItemPropertiesMediator extends UIItemPropertiesMedi } @Override - protected void translateObservableDataToView(Entity entity) { - spineObjectComponent = ComponentRetriever.get(entity, SpineObjectComponent.class); - spineDataComponent = ComponentRetriever.get(entity, SpineDataComponent.class); + protected void translateObservableDataToView(int entity) { + spineObjectComponent = SandboxComponentRetriever.get(entity, SpineObjectComponent.class); + spineDataComponent = SandboxComponentRetriever.get(entity, SpineDataComponent.class); Array animations = new Array<>(); for (Animation animation : spineObjectComponent.getAnimations()) { diff --git a/src/main/java/games/rednblack/editor/view/ui/properties/panels/UISpriteAnimationItemPropertiesMediator.java b/src/main/java/games/rednblack/editor/view/ui/properties/panels/UISpriteAnimationItemPropertiesMediator.java index 932daeb0..a6d46063 100644 --- a/src/main/java/games/rednblack/editor/view/ui/properties/panels/UISpriteAnimationItemPropertiesMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/properties/panels/UISpriteAnimationItemPropertiesMediator.java @@ -18,9 +18,9 @@ package games.rednblack.editor.view.ui.properties.panels; -import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.utils.Array; import games.rednblack.editor.renderer.components.MainItemComponent; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.h2d.common.MsgAPI; import games.rednblack.editor.controller.commands.component.UpdateSpriteAnimationDataCommand; import games.rednblack.editor.renderer.components.sprite.SpriteAnimationComponent; @@ -32,7 +32,7 @@ import org.puremvc.java.interfaces.INotification; /** * Created by azakhary on 4/16/2015. */ -public class UISpriteAnimationItemPropertiesMediator extends UIItemPropertiesMediator { +public class UISpriteAnimationItemPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UISpriteAnimationItemPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -66,9 +66,9 @@ public class UISpriteAnimationItemPropertiesMediator extends UIItemPropertiesMed } @Override - protected void translateObservableDataToView(Entity entity) { + protected void translateObservableDataToView(int entity) { - spriteAnimationComponent = ComponentRetriever.get(entity, SpriteAnimationComponent.class); + spriteAnimationComponent = SandboxComponentRetriever.get(entity, SpriteAnimationComponent.class); Array animations = new Array<>(); spriteAnimationComponent.frameRangeMap.keySet().forEach(animations::add); diff --git a/src/main/java/games/rednblack/editor/view/ui/properties/panels/UITalosPropertiesMediator.java b/src/main/java/games/rednblack/editor/view/ui/properties/panels/UITalosPropertiesMediator.java index 3d0f88b7..d0c60072 100644 --- a/src/main/java/games/rednblack/editor/view/ui/properties/panels/UITalosPropertiesMediator.java +++ b/src/main/java/games/rednblack/editor/view/ui/properties/panels/UITalosPropertiesMediator.java @@ -1,13 +1,14 @@ package games.rednblack.editor.view.ui.properties.panels; -import com.badlogic.ashley.core.Entity; import games.rednblack.editor.controller.commands.component.UpdateTalosDataCommand; import games.rednblack.editor.renderer.components.particle.TalosDataComponent; import games.rednblack.editor.renderer.data.TalosVO; +import games.rednblack.editor.renderer.utils.ComponentRetriever; +import games.rednblack.editor.utils.runtime.SandboxComponentRetriever; import games.rednblack.editor.view.ui.properties.UIItemPropertiesMediator; import games.rednblack.h2d.common.MsgAPI; -public class UITalosPropertiesMediator extends UIItemPropertiesMediator { +public class UITalosPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UITalosPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -17,8 +18,8 @@ public class UITalosPropertiesMediator extends UIItemPropertiesMediator { +public class UITypingLabelPropertiesMediator extends UIItemPropertiesMediator { private static final String TAG = UITypingLabelPropertiesMediator.class.getCanonicalName(); public static final String NAME = TAG; @@ -44,12 +44,12 @@ public class UITypingLabelPropertiesMediator extends UIItemPropertiesMediator