diff --git a/core/assets/prefabs/objects/bug.prefab b/core/assets/prefabs/objects/bug.prefab index c296770..d4ede9a 100644 --- a/core/assets/prefabs/objects/bug.prefab +++ b/core/assets/prefabs/objects/bug.prefab @@ -41,5 +41,11 @@ "FactionMemberComponent": { "factionName": "bug" }, - "PlatformMovableComponent": {} + "PlatformMovableComponent": {}, + "ObjectInEditorComponent": { + "displayName": "Bug", + "renderSize": "1,1,1", + "renderTranslate": "0,0,0", + "placementTranslate": "0.5,0,0.5" + } } \ No newline at end of file diff --git a/core/assets/prefabs/objects/bugWithGun.prefab b/core/assets/prefabs/objects/bugWithGun.prefab index e4c5942..5341eff 100644 --- a/core/assets/prefabs/objects/bugWithGun.prefab +++ b/core/assets/prefabs/objects/bugWithGun.prefab @@ -52,5 +52,11 @@ "projectileShootFrequency": 3000, "projectileSpeed": 6 }, - "PlatformMovableComponent": {} + "PlatformMovableComponent": {}, + "ObjectInEditorComponent": { + "displayName": "Bug with gun", + "renderSize": "1,1,1", + "renderTranslate": "0,0,0", + "placementTranslate": "0.5,0,0.5" + } } \ No newline at end of file diff --git a/core/assets/prefabs/objects/cycleDoor.prefab b/core/assets/prefabs/objects/cycleDoor.prefab index bbc2bb5..7f06368 100644 --- a/core/assets/prefabs/objects/cycleDoor.prefab +++ b/core/assets/prefabs/objects/cycleDoor.prefab @@ -29,5 +29,10 @@ "interpolationAway": "linear", "interpolationBack": "bounceOut" }, - "BaseLocationComponent": {} + "BaseLocationComponent": {}, + "ObjectInEditorComponent": { + "displayName": "Cycle door", + "renderSize": "0.2,2,1", + "renderTranslate": "0.4,0,0" + } } \ No newline at end of file diff --git a/core/assets/prefabs/objects/lever.prefab b/core/assets/prefabs/objects/lever.prefab index 280d4a7..f77bcda 100644 --- a/core/assets/prefabs/objects/lever.prefab +++ b/core/assets/prefabs/objects/lever.prefab @@ -31,5 +31,10 @@ "G3DModelActivateComponent": { "activateAnimation": "Armature|TurnOff", "deactivateAnimation": "Armature|TurnOn" + }, + "ObjectInEditorComponent": { + "displayName": "Lever", + "renderSize": "0.6,0.6,0.2", + "renderTranslate": "0.2,0,0.8" } } \ No newline at end of file diff --git a/core/assets/prefabs/objects/pressurePlate.prefab b/core/assets/prefabs/objects/pressurePlate.prefab index 2783863..ee670ad 100644 --- a/core/assets/prefabs/objects/pressurePlate.prefab +++ b/core/assets/prefabs/objects/pressurePlate.prefab @@ -18,5 +18,10 @@ "translateY": 1, "width": 1, "height": 0.1 + }, + "ObjectInEditorComponent": { + "displayName": "Pressure plate", + "renderSize": "1,1,1", + "renderTranslate": "0,0,0" } } \ No newline at end of file diff --git a/core/assets/prefabs/objects/signalDoor.prefab b/core/assets/prefabs/objects/signalDoor.prefab index 3c544c6..cf2a2fb 100644 --- a/core/assets/prefabs/objects/signalDoor.prefab +++ b/core/assets/prefabs/objects/signalDoor.prefab @@ -26,5 +26,10 @@ "moveTime": 1500, "interpolation": "linear" }, - "BaseLocationComponent": {} + "BaseLocationComponent": {}, + "ObjectInEditorComponent": { + "displayName": "Signal door", + "renderSize": "0.2,2,1", + "renderTranslate": "0.4,0,0" + } } \ No newline at end of file diff --git a/core/assets/prefabs/objects/signalIndicator.prefab b/core/assets/prefabs/objects/signalIndicator.prefab index 270fc40..3867fd8 100644 --- a/core/assets/prefabs/objects/signalIndicator.prefab +++ b/core/assets/prefabs/objects/signalIndicator.prefab @@ -9,5 +9,10 @@ "signalOnGreen": 127, "signalOnBlue": 0 }, - "SignalConsumerComponent": {} + "SignalConsumerComponent": {}, + "ObjectInEditorComponent": { + "displayName": "Signal indicator", + "renderSize": "0.2,0.2,0.2", + "renderTranslate": "0.4,0.4,0" + } } \ No newline at end of file diff --git a/core/assets/prefabs/objects/signalStonePlatform.prefab b/core/assets/prefabs/objects/signalStonePlatform.prefab index af5728c..a5c6d33 100644 --- a/core/assets/prefabs/objects/signalStonePlatform.prefab +++ b/core/assets/prefabs/objects/signalStonePlatform.prefab @@ -23,5 +23,10 @@ "translateY": 0.5, "width": 2, "height": 0.1 + }, + "ObjectInEditorComponent": { + "displayName": "Signal stone platform", + "renderSize": "2,0.5,1", + "renderTranslate": "0,0,0" } } \ No newline at end of file diff --git a/core/assets/prefabs/objects/star.prefab b/core/assets/prefabs/objects/star.prefab index b8c4f32..2ecec77 100644 --- a/core/assets/prefabs/objects/star.prefab +++ b/core/assets/prefabs/objects/star.prefab @@ -21,5 +21,11 @@ "ModelRotateComponent": {}, "ConstantModelRotationComponent": { "degreesPerSecond": 180 + }, + "ObjectInEditorComponent": { + "displayName": "Star", + "renderSize": "1,1,1", + "renderTranslate": "0,0,0", + "placementTranslate": "0.5,0,0.5" } } \ No newline at end of file diff --git a/core/assets/prefabs/objects/stoneBack.prefab b/core/assets/prefabs/objects/stoneBack.prefab index dd40f74..8a0fdb0 100644 --- a/core/assets/prefabs/objects/stoneBack.prefab +++ b/core/assets/prefabs/objects/stoneBack.prefab @@ -18,5 +18,10 @@ "MoveActivatorComponent": { "distanceZ": 1, "moveTime": 1000 + }, + "ObjectInEditorComponent": { + "displayName": "Stone to front", + "renderSize": "1,1,1", + "renderTranslate": "0,0,0" } } \ No newline at end of file diff --git a/core/assets/prefabs/objects/stoneFront.prefab b/core/assets/prefabs/objects/stoneFront.prefab index ed19753..a81b928 100644 --- a/core/assets/prefabs/objects/stoneFront.prefab +++ b/core/assets/prefabs/objects/stoneFront.prefab @@ -18,5 +18,10 @@ "MoveActivatorComponent": { "distanceZ": -1, "moveTime": 1000 + }, + "ObjectInEditorComponent": { + "displayName": "Stone to back", + "renderSize": "1,1,1", + "renderTranslate": "0,0,0" } } \ No newline at end of file diff --git a/core/assets/prefabs/objects/stonePlatform.prefab b/core/assets/prefabs/objects/stonePlatform.prefab index 187feba..2a75127 100644 --- a/core/assets/prefabs/objects/stonePlatform.prefab +++ b/core/assets/prefabs/objects/stonePlatform.prefab @@ -24,5 +24,10 @@ "translateY": 0.5, "width": 2, "height": 0.1 + }, + "ObjectInEditorComponent": { + "displayName": "Stone platform", + "renderSize": "2,0.5,1", + "renderTranslate": "0,0,0" } } \ No newline at end of file diff --git a/core/assets/prefabs/objects/tombstone.prefab b/core/assets/prefabs/objects/tombstone.prefab index bd6588a..431645d 100644 --- a/core/assets/prefabs/objects/tombstone.prefab +++ b/core/assets/prefabs/objects/tombstone.prefab @@ -11,5 +11,10 @@ "prefabName": "ghost", "distanceZ": 0.5, "distanceX": 0.5 + }, + "ObjectInEditorComponent": { + "displayName": "Tombstone", + "renderSize": "1,1,1", + "renderTranslate": "0,0,0" } } \ No newline at end of file diff --git a/core/assets/prefabs/objects/torch.prefab b/core/assets/prefabs/objects/torch.prefab index acddd60..f250398 100644 --- a/core/assets/prefabs/objects/torch.prefab +++ b/core/assets/prefabs/objects/torch.prefab @@ -14,5 +14,10 @@ "green": 255, "blue": 127, "intensity": 5 + }, + "ObjectInEditorComponent": { + "displayName": "Torch", + "renderSize": "1,1,1", + "renderTranslate": "0,0,0" } } \ No newline at end of file diff --git a/core/src/main/java/jgd/platformer/Platformer.java b/core/src/main/java/jgd/platformer/Platformer.java index ec23520..e492210 100644 --- a/core/src/main/java/jgd/platformer/Platformer.java +++ b/core/src/main/java/jgd/platformer/Platformer.java @@ -221,6 +221,7 @@ public void render() { public void resize(int width, int height) { menuContext.getSystem(RenderingEngine.class).screenResized(width, height); gameplayContext.getSystem(RenderingEngine.class).screenResized(width, height); + editorContext.getSystem(RenderingEngine.class).screenResized(width, height); } @Override diff --git a/core/src/main/java/jgd/platformer/editor/EditorLogicSystem.java b/core/src/main/java/jgd/platformer/editor/EditorLogicSystem.java index e0cb0ad..c189df5 100644 --- a/core/src/main/java/jgd/platformer/editor/EditorLogicSystem.java +++ b/core/src/main/java/jgd/platformer/editor/EditorLogicSystem.java @@ -1,31 +1,119 @@ package jgd.platformer.editor; +import com.badlogic.gdx.graphics.GL20; +import com.badlogic.gdx.graphics.Mesh; +import com.badlogic.gdx.graphics.VertexAttribute; +import com.badlogic.gdx.graphics.g3d.Material; +import com.badlogic.gdx.graphics.g3d.Model; +import com.badlogic.gdx.graphics.g3d.ModelBatch; +import com.badlogic.gdx.graphics.g3d.ModelInstance; +import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute; +import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder; import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.Vector3; +import com.gempukku.gaming.rendering.event.RenderEnvironment; +import com.gempukku.secsy.context.annotation.Inject; import com.gempukku.secsy.context.annotation.RegisterSystem; +import com.gempukku.secsy.context.system.LifeCycleSystem; import com.gempukku.secsy.entity.EntityRef; import com.gempukku.secsy.entity.dispatch.ReceiveEvent; import jgd.platformer.editor.controls.MouseTracked; import jgd.platformer.editor.controls.PlaceObject; import jgd.platformer.editor.ui.BlockTypeSelected; +import jgd.platformer.editor.ui.ObjectTypeSelected; import jgd.platformer.gameplay.level.LevelComponent; +import jgd.platformer.gameplay.logic.spawning.PlatformerEntitySpawner; import jgd.platformer.gameplay.rendering.platform.RebuildBlockMesh; +import java.util.Collections; import java.util.Map; @RegisterSystem( profiles = {"gameScreen", "editor"} ) -public class EditorLogicSystem { +public class EditorLogicSystem implements LifeCycleSystem { + @Inject + private PlatformerEntitySpawner platformerEntitySpawner; + private Vector3 lastMousePosition = new Vector3(); + private float snapSize = 0.25f; + private String lastSelectedBlockType; + private ObjectTypeSelected lastSelectedObjectType; + + private Model model; + private ModelInstance modelInstance; + + private ModelBatch modelBatch; + + @Override + public void initialize() { + float size = 1; + + float[] vertices = { + 0, 0, 0, + 0, 0, size, + 0, size, 0, + 0, size, size, + size, 0, 0, + size, 0, size, + size, size, 0, + size, size, size}; + + short[] indices = { + 0, 1, + 0, 2, + 1, 3, + 2, 3, + + 4, 5, + 4, 6, + 5, 7, + 6, 7, + + 0, 4, + 1, 5, + 2, 6, + 3, 7}; + + Mesh mesh = new Mesh(true, vertices.length / 3, indices.length, VertexAttribute.Position()); + mesh.setVertices(vertices); + mesh.setIndices(indices); + + ModelBuilder modelBuilder = new ModelBuilder(); + modelBuilder.begin(); + modelBuilder.part("cube", mesh, GL20.GL_LINES, new Material(ColorAttribute.createDiffuse(1, 1, 1, 1))); + model = modelBuilder.end(); + modelInstance = new ModelInstance(model); + modelBatch = new ModelBatch(); + } + + @ReceiveEvent + public void renderCube(RenderEnvironment event, EntityRef entityRef) { + if (lastMousePosition != null) { + if (lastSelectedBlockType != null) { + modelInstance.transform.idt().translate(lastMousePosition); + } else if (lastSelectedObjectType != null) { + modelInstance.transform.idt().translate(lastMousePosition) + .translate(lastSelectedObjectType.getRenderTranslate()).scl(lastSelectedObjectType.getRenderSize()); + } + + event.getRenderPipeline().getCurrentBuffer().begin(); + modelBatch.begin(event.getCamera()); + modelBatch.render(modelInstance); + modelBatch.end(); + event.getRenderPipeline().getCurrentBuffer().end(); + } + } @ReceiveEvent public void mouseTracked(MouseTracked mouseTracked, EntityRef entityRef) { Vector3 position = mouseTracked.getPosition(); boolean snap = mouseTracked.isSnap(); if (snap) - lastMousePosition.set(MathUtils.round(position.x - 0.5f), MathUtils.round(position.y - 0.5f), MathUtils.round(position.z)); + lastMousePosition.set(MathUtils.round((position.x - 0.5f) / snapSize) * snapSize, + MathUtils.round((position.y - 0.5f) / snapSize) * snapSize, + MathUtils.round(position.z / snapSize) * snapSize); else lastMousePosition.set(position.x - 0.5f, position.y - 0.5f, position.z); } @@ -35,6 +123,15 @@ public void blockTypeSelected(BlockTypeSelected blockTypeSelected, EntityRef ent lastSelectedBlockType = blockTypeSelected.getPrefabName(); } + @ReceiveEvent + public void objectTypeSelected(ObjectTypeSelected objectTypeSelected, EntityRef entityRef) { + if (objectTypeSelected.getPrefabName() != null) { + lastSelectedObjectType = objectTypeSelected; + } else { + lastSelectedObjectType = null; + } + } + @ReceiveEvent public void placeObject(PlaceObject placeObject, EntityRef entityRef, LevelComponent levelComponent) { if (lastSelectedBlockType != null) { @@ -47,5 +144,20 @@ public void placeObject(PlaceObject placeObject, EntityRef entityRef, LevelCompo entityRef.send(new RebuildBlockMesh()); } + if (lastSelectedObjectType != null) { + Map objectCoordinates = levelComponent.getObjectCoordinates(); + Vector3 placementTranslate = lastSelectedObjectType.getPlacementTranslate(); + float x = lastMousePosition.x + placementTranslate.x; + float y = lastMousePosition.y + placementTranslate.y; + float z = lastMousePosition.z + placementTranslate.z; + String position = x + "," + y + "," + z; + String prefabName = lastSelectedObjectType.getPrefabName(); + objectCoordinates.put(position, prefabName); + + levelComponent.setObjectCoordinates(objectCoordinates); + entityRef.saveChanges(); + + platformerEntitySpawner.createEntityAt(x, y, z, prefabName, Collections.emptyMap()); + } } } diff --git a/core/src/main/java/jgd/platformer/editor/rendering/SelectionRenderer.java b/core/src/main/java/jgd/platformer/editor/rendering/SelectionRenderer.java deleted file mode 100644 index a8bff57..0000000 --- a/core/src/main/java/jgd/platformer/editor/rendering/SelectionRenderer.java +++ /dev/null @@ -1,95 +0,0 @@ -package jgd.platformer.editor.rendering; - -import com.badlogic.gdx.graphics.GL20; -import com.badlogic.gdx.graphics.Mesh; -import com.badlogic.gdx.graphics.VertexAttribute; -import com.badlogic.gdx.graphics.g3d.Material; -import com.badlogic.gdx.graphics.g3d.Model; -import com.badlogic.gdx.graphics.g3d.ModelBatch; -import com.badlogic.gdx.graphics.g3d.ModelInstance; -import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute; -import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder; -import com.badlogic.gdx.math.MathUtils; -import com.badlogic.gdx.math.Vector3; -import com.gempukku.gaming.rendering.event.RenderEnvironment; -import com.gempukku.secsy.context.annotation.RegisterSystem; -import com.gempukku.secsy.context.system.LifeCycleSystem; -import com.gempukku.secsy.entity.EntityRef; -import com.gempukku.secsy.entity.dispatch.ReceiveEvent; -import jgd.platformer.editor.controls.MouseTracked; - -@RegisterSystem( - profiles = {"gameScreen", "editor"}) -public class SelectionRenderer implements LifeCycleSystem { - private Vector3 mousePosition = new Vector3(); - - private Model model; - private ModelInstance modelInstance; - - private ModelBatch modelBatch; - - @Override - public void initialize() { - float size = 1; - - float[] vertices = { - 0, 0, 0, - 0, 0, size, - 0, size, 0, - 0, size, size, - size, 0, 0, - size, 0, size, - size, size, 0, - size, size, size}; - - short[] indices = { - 0, 1, - 0, 2, - 1, 3, - 2, 3, - - 4, 5, - 4, 6, - 5, 7, - 6, 7, - - 0, 4, - 1, 5, - 2, 6, - 3, 7}; - - Mesh mesh = new Mesh(true, vertices.length / 3, indices.length, VertexAttribute.Position()); - mesh.setVertices(vertices); - mesh.setIndices(indices); - - ModelBuilder modelBuilder = new ModelBuilder(); - modelBuilder.begin(); - modelBuilder.part("cube", mesh, GL20.GL_LINES, new Material(ColorAttribute.createDiffuse(1, 1, 1, 1))); - model = modelBuilder.end(); - modelInstance = new ModelInstance(model); - modelBatch = new ModelBatch(); - } - - @ReceiveEvent - public void mouseTracked(MouseTracked mouseTracked, EntityRef entityRef) { - Vector3 position = mouseTracked.getPosition(); - boolean snap = mouseTracked.isSnap(); - if (snap) - mousePosition.set(MathUtils.round(position.x - 0.5f), MathUtils.round(position.y - 0.5f), MathUtils.round(position.z)); - else - mousePosition.set(position.x - 0.5f, position.y - 0.5f, position.z); - } - - @ReceiveEvent - public void renderCube(RenderEnvironment event, EntityRef entityRef) { - if (mousePosition != null) { - modelInstance.transform.idt().translate(mousePosition); - - event.getRenderPipeline().getCurrentBuffer().begin(); - modelBatch.begin(event.getCamera()); - modelBatch.render(modelInstance); - modelBatch.end(); - event.getRenderPipeline().getCurrentBuffer().end(); - } - } -} diff --git a/core/src/main/java/jgd/platformer/editor/ui/LevelEditorMenuSystem.java b/core/src/main/java/jgd/platformer/editor/ui/LevelEditorMenuSystem.java index 3c6417f..a21dd0b 100644 --- a/core/src/main/java/jgd/platformer/editor/ui/LevelEditorMenuSystem.java +++ b/core/src/main/java/jgd/platformer/editor/ui/LevelEditorMenuSystem.java @@ -1,6 +1,7 @@ package jgd.platformer.editor.ui; import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.ui.*; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; @@ -28,7 +29,7 @@ public class LevelEditorMenuSystem implements LifeCycleSystem { @Inject private StageProvider stageProvider; - private TextButton selectedBlockButton; + private TextButton selectedButton; private EntityRef levelEntity; @@ -36,6 +37,60 @@ public class LevelEditorMenuSystem implements LifeCycleSystem { public void initialize() { Skin uiSkin = new Skin(Gdx.files.internal("uiskin.json")); + Window blocksWindow = createBlocksWindow(uiSkin); + stageProvider.getStage().addActor(blocksWindow); + + Window objectsWindow = createObjectsWindow(uiSkin); + stageProvider.getStage().addActor(objectsWindow); + } + + private Window createObjectsWindow(Skin uiSkin) { + Window objectsWindow = new Window("Objects", uiSkin); + objectsWindow.setResizable(true); + objectsWindow.setMovable(true); + + Table objectTable = new Table(uiSkin); + objectTable.top(); + objectTable.defaults().height(20).align(Align.left); + + ScrollPane scrollPane = new ScrollPane(objectTable, uiSkin); + scrollPane.setFadeScrollBars(false); + + for (NamedEntityData namedEntityData : prefabManager.findNamedPrefabsWithComponents(ObjectInEditorComponent.class)) { + String prefabName = namedEntityData.getName(); + + ObjectInEditorComponent objectInEditor = entityManager.wrapEntityData(namedEntityData).getComponent(ObjectInEditorComponent.class); + String displayName = objectInEditor.getDisplayName(); + Vector3 renderSize = objectInEditor.getRenderSize(); + Vector3 renderTranslate = objectInEditor.getRenderTranslate(); + Vector3 placementTranslate = objectInEditor.getPlacementTranslate(); + + TextButton objectButton = new TextButton(displayName, uiSkin, "toggle"); + objectButton.addListener( + new ChangeListener() { + @Override + public void changed(ChangeEvent event, Actor actor) { + if (objectButton.isChecked()) { + if (selectedButton != null) { + selectedButton.setChecked(false); + } + selectedButton = objectButton; + levelEntity.send(new ObjectTypeSelected(prefabName, renderSize, renderTranslate, placementTranslate)); + } else { + selectedButton = null; + levelEntity.send(new ObjectTypeSelected(null, null, null, null)); + } + } + }); + + objectTable.add(objectButton).fillX().expandX().row(); + } + + objectsWindow.add(scrollPane).fill().expand(); + return objectsWindow; + } + + private Window createBlocksWindow(Skin uiSkin) { Window blocksWindow = new Window("Blocks", uiSkin); blocksWindow.setResizable(true); blocksWindow.setMovable(true); @@ -58,13 +113,13 @@ public void initialize() { @Override public void changed(ChangeEvent event, Actor actor) { if (blockButton.isChecked()) { - if (selectedBlockButton != null) { - selectedBlockButton.setChecked(false); + if (selectedButton != null) { + selectedButton.setChecked(false); } - selectedBlockButton = blockButton; + selectedButton = blockButton; levelEntity.send(new BlockTypeSelected(prefabName)); } else { - selectedBlockButton = null; + selectedButton = null; levelEntity.send(new BlockTypeSelected(null)); } } @@ -74,8 +129,7 @@ public void changed(ChangeEvent event, Actor actor) { } blocksWindow.add(scrollPane).fill().expand(); - - stageProvider.getStage().addActor(blocksWindow); + return blocksWindow; } @ReceiveEvent diff --git a/core/src/main/java/jgd/platformer/editor/ui/ObjectInEditorComponent.java b/core/src/main/java/jgd/platformer/editor/ui/ObjectInEditorComponent.java new file mode 100644 index 0000000..37aa478 --- /dev/null +++ b/core/src/main/java/jgd/platformer/editor/ui/ObjectInEditorComponent.java @@ -0,0 +1,18 @@ +package jgd.platformer.editor.ui; + +import com.badlogic.gdx.math.Vector3; +import com.gempukku.secsy.entity.Component; + +public interface ObjectInEditorComponent extends Component { + String getDisplayName(); + + Vector3 getRenderSize(); + + Vector3 getRenderTranslate(); + + default Vector3 getPlacementTranslate() { + return new Vector3(); + } + + ; +} diff --git a/core/src/main/java/jgd/platformer/editor/ui/ObjectTypeSelected.java b/core/src/main/java/jgd/platformer/editor/ui/ObjectTypeSelected.java new file mode 100644 index 0000000..dececc5 --- /dev/null +++ b/core/src/main/java/jgd/platformer/editor/ui/ObjectTypeSelected.java @@ -0,0 +1,34 @@ +package jgd.platformer.editor.ui; + +import com.badlogic.gdx.math.Vector3; +import com.gempukku.secsy.entity.event.Event; + +public class ObjectTypeSelected extends Event { + private String prefabName; + private Vector3 renderSize; + private Vector3 renderTranslate; + private Vector3 placementTranslate; + + public ObjectTypeSelected(String prefabName, Vector3 renderSize, Vector3 renderTranslate, Vector3 placementTranslate) { + this.prefabName = prefabName; + this.renderSize = renderSize; + this.renderTranslate = renderTranslate; + this.placementTranslate = placementTranslate; + } + + public String getPrefabName() { + return prefabName; + } + + public Vector3 getPlacementTranslate() { + return placementTranslate; + } + + public Vector3 getRenderSize() { + return renderSize; + } + + public Vector3 getRenderTranslate() { + return renderTranslate; + } +} diff --git a/core/src/main/java/jgd/platformer/gameplay/level/LevelComponent.java b/core/src/main/java/jgd/platformer/gameplay/level/LevelComponent.java index 9e9be3b..3ed0c1f 100644 --- a/core/src/main/java/jgd/platformer/gameplay/level/LevelComponent.java +++ b/core/src/main/java/jgd/platformer/gameplay/level/LevelComponent.java @@ -7,10 +7,11 @@ public interface LevelComponent extends Component { Map getBlockCoordinates(); - void setBlockCoordinates(Map blockCoordinates); Map getObjectCoordinates(); + void setObjectCoordinates(Map objectCoordinates); + List getAdditionalObjects(); } diff --git a/gaming/src/main/java/com/gempukku/gaming/asset/component/ReflectionsComponentFieldConverter.java b/gaming/src/main/java/com/gempukku/gaming/asset/component/ReflectionsComponentFieldConverter.java index a7f3964..a8110bb 100644 --- a/gaming/src/main/java/com/gempukku/gaming/asset/component/ReflectionsComponentFieldConverter.java +++ b/gaming/src/main/java/com/gempukku/gaming/asset/component/ReflectionsComponentFieldConverter.java @@ -64,7 +64,6 @@ public void init() { @Override public String convertFrom(T value, Class clazz) { - System.out.println("Converter called"); init(); ComponentFieldTypeConverter converter = converterMap.get(clazz); if (converter == null) @@ -74,7 +73,6 @@ public String convertFrom(T value, Class clazz) { @Override public T convertTo(String value, Class clazz) { - System.out.println("Converter called"); init(); ComponentFieldTypeConverter converter = converterMap.get(clazz); if (converter == null)