From 645433610f093b81eb61f5fd603b8dcc1d025c9b Mon Sep 17 00:00:00 2001 From: Johannes Schmelz Date: Sun, 8 Dec 2024 02:43:58 +0100 Subject: [PATCH] added control for figures --- .../pp/monopoly/client/gui/BobTheBuilder.java | 2 +- .../pp/monopoly/client/gui/FigureControl.java | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/FigureControl.java diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/BobTheBuilder.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/BobTheBuilder.java index acaf8a6..a6abeb7 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/BobTheBuilder.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/BobTheBuilder.java @@ -43,7 +43,7 @@ public class BobTheBuilder extends GameBoardSynchronizer { // Setze die Rotation basierend auf der Feld-ID node.setLocalRotation(figure.getRot().toQuaternion()); - // node.addControl(new FigureControl(figure)); + node.addControl(new FigureControl(figure)); return node; } diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/FigureControl.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/FigureControl.java new file mode 100644 index 0000000..0d7da19 --- /dev/null +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/FigureControl.java @@ -0,0 +1,28 @@ +package pp.monopoly.client.gui; + +import com.jme3.renderer.RenderManager; +import com.jme3.renderer.ViewPort; +import com.jme3.scene.control.AbstractControl; + +import pp.monopoly.model.Figure; + +public class FigureControl extends AbstractControl { + + private final Figure figure; + + public FigureControl(Figure figure) { + super(); + this.figure = figure; + } + + @Override + protected void controlUpdate(float tpf) { + //TODO: animation + } + + @Override + protected void controlRender(RenderManager rm, ViewPort vp) { + // No rendering required + } + +}