summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/engine
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-15 11:23:55 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-15 11:23:55 +0200
commit488ff296ed4c415c611ace87e244f398afa8d065 (patch)
treeba6540a9905b6413dd2b72f12a4bac3724ab1966 /core/src/ch/asynk/tankontank/engine
parent7d2af8ef387acb34b82d44610b6ac79724aade21 (diff)
downloadRustAndDust-488ff296ed4c415c611ace87e244f398afa8d065.zip
RustAndDust-488ff296ed4c415c611ace87e244f398afa8d065.tar.gz
Moveable interface comes in once again
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Pawn.java11
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/Drawable.java1
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/Moveable.java12
3 files changed, 21 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java
index 83cd642..d646915 100644
--- a/core/src/ch/asynk/tankontank/engine/Pawn.java
+++ b/core/src/ch/asynk/tankontank/engine/Pawn.java
@@ -14,13 +14,13 @@ import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import ch.asynk.tankontank.engine.gfx.Image;
-import ch.asynk.tankontank.engine.gfx.Drawable;
+import ch.asynk.tankontank.engine.gfx.Moveable;
import ch.asynk.tankontank.engine.gfx.StackedImages;
import ch.asynk.tankontank.engine.gfx.animations.MoveToAnimation;
import ch.asynk.tankontank.engine.gfx.animations.RunnableAnimation;
import ch.asynk.tankontank.engine.gfx.animations.AnimationSequence;
-public abstract class Pawn implements Drawable, Disposable
+public abstract class Pawn implements Moveable, Disposable
{
public class Attack
{
@@ -125,26 +125,31 @@ public abstract class Pawn implements Drawable, Disposable
return pos;
}
+ @Override
public float getX()
{
return image.getX();
}
+ @Override
public float getY()
{
return image.getY();
}
+ @Override
public float getWidth()
{
return image.getWidth();
}
+ @Override
public float getHeight()
{
return image.getHeight();
}
+ @Override
public float getRotation()
{
return image.getRotation();
@@ -155,6 +160,7 @@ public abstract class Pawn implements Drawable, Disposable
return Orientation.fromRotation(getRotation());
}
+ @Override
public void setPosition(float x, float y)
{
position.set(x, y, 0f);
@@ -171,6 +177,7 @@ public abstract class Pawn implements Drawable, Disposable
overlays.setRotation(z);
}
+ @Override
public void setPosition(float x, float y, float z)
{
setPosition(x, y);
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java b/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java
index 0338727..433a019 100644
--- a/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java
+++ b/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java
@@ -6,6 +6,5 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
public interface Drawable
{
public void draw(Batch batch);
-
public void drawDebug(ShapeRenderer debugShapes);
}
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/Moveable.java b/core/src/ch/asynk/tankontank/engine/gfx/Moveable.java
new file mode 100644
index 0000000..238305e
--- /dev/null
+++ b/core/src/ch/asynk/tankontank/engine/gfx/Moveable.java
@@ -0,0 +1,12 @@
+package ch.asynk.tankontank.engine.gfx;
+
+public interface Moveable extends Drawable
+{
+ public float getX();
+ public float getY();
+ public float getWidth();
+ public float getHeight();
+ public float getRotation();
+ public void setPosition(float x, float y);
+ public void setPosition(float x, float y, float r);
+}