From 83d8f54a160fa4fdc2cd84705966acea2acb4888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 20 Sep 2014 22:47:10 +0200 Subject: split Drawable into Drawable and BasicDrawable --- .../asynk/tankontank/engine/gfx/BasicDrawable.java | 13 +++++++++++ .../ch/asynk/tankontank/engine/gfx/Drawable.java | 26 +++++++--------------- 2 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java diff --git a/core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java b/core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java new file mode 100644 index 0000000..f143505 --- /dev/null +++ b/core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java @@ -0,0 +1,13 @@ +package ch.asynk.tankontank.engine.gfx; + +import com.badlogic.gdx.graphics.g2d.Batch; +import com.badlogic.gdx.graphics.glutils.ShapeRenderer; + +public interface BasicDrawable +{ + public void setPosition(float x, float y, float r); + + public void draw(Batch batch, float parentAlpha); + + public void drawDebug(ShapeRenderer debugShapes); +} diff --git a/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java b/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java index 8f39e87..e5f1858 100644 --- a/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java +++ b/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java @@ -1,32 +1,22 @@ package ch.asynk.tankontank.engine.gfx; -import com.badlogic.gdx.graphics.g2d.Batch; -import com.badlogic.gdx.graphics.glutils.ShapeRenderer; -import com.badlogic.gdx.utils.Disposable; - -public interface Drawable extends Disposable +public interface Drawable extends BasicDrawable { - public float getWidth(); - - public float getHeight(); - public float getX(); public float getY(); - public float getRotation(); - - public void setRotation(float r); + public float getWidth(); - public void setScale(float s); + public float getHeight(); - public void setPosition(float x, float y); + public float getRotation(); - public void moveBy(float dx, float dy); + public void setScale(float s); - public void setCoords(float x, float y, float r); + public void setRotation(float r); - public void draw(Batch batch, float parentAlpha); + public void translate(float dx, float dy); - public void drawDebug(ShapeRenderer debugShapes); + public void setPosition(float x, float y); } -- cgit v1.1-2-g2b99