summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-09-22 17:20:30 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-09-22 17:20:30 +0200
commit31a06d9af7554a0a802c7e8afaae045c4eed8bd3 (patch)
treeb16724e8030d840375330d48ff32a12c00dab132 /core/src
parente799b4ab3be2f63a6aebda1187eaeb1f11c060fd (diff)
downloadRustAndDust-31a06d9af7554a0a802c7e8afaae045c4eed8bd3.zip
RustAndDust-31a06d9af7554a0a802c7e8afaae045c4eed8bd3.tar.gz
move translate from Drawable to BasicDrawable
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Tile.java9
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java2
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/Drawable.java2
-rw-r--r--core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java8
4 files changed, 19 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Tile.java b/core/src/ch/asynk/tankontank/engine/Tile.java
index 96c6d60..6f40f8c 100644
--- a/core/src/ch/asynk/tankontank/engine/Tile.java
+++ b/core/src/ch/asynk/tankontank/engine/Tile.java
@@ -70,11 +70,19 @@ public abstract class Tile implements BasicDrawable
return null;
}
+ @Override
+ public void translate(float x, float y)
+ {
+ overlays.translate(x, y);
+ }
+
+ @Override
public void setPosition(float x, float y, float z)
{
overlays.setPosition(x, y, z);
}
+ @Override
public void draw(Batch batch, float parentAlpha)
{
overlays.draw(batch, parentAlpha);
@@ -83,6 +91,7 @@ public abstract class Tile implements BasicDrawable
pawn.draw(batch, parentAlpha);
}
+ @Override
public void drawDebug(ShapeRenderer debugShapes)
{
overlays.drawDebug(debugShapes);
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java b/core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java
index f143505..776ac22 100644
--- a/core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java
+++ b/core/src/ch/asynk/tankontank/engine/gfx/BasicDrawable.java
@@ -5,6 +5,8 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
public interface BasicDrawable
{
+ public void translate(float dx, float dy);
+
public void setPosition(float x, float y, float r);
public void draw(Batch batch, float parentAlpha);
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java b/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java
index e5f1858..ca749be 100644
--- a/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java
+++ b/core/src/ch/asynk/tankontank/engine/gfx/Drawable.java
@@ -16,7 +16,5 @@ public interface Drawable extends BasicDrawable
public void setRotation(float r);
- public void translate(float dx, float dy);
-
public void setPosition(float x, float y);
}
diff --git a/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java b/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java
index 8e450ad..5eb5e55 100644
--- a/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java
+++ b/core/src/ch/asynk/tankontank/engine/gfx/StackedImages.java
@@ -30,6 +30,14 @@ public class StackedImages implements BasicDrawable
}
@Override
+ public void translate(float x, float y)
+ {
+ for (int i = 0; i < sprites.size; i++) {
+ sprites.get(i).translate(x, y);
+ }
+ }
+
+ @Override
public void setPosition(float x, float y, float r)
{
for (int i = 0; i < sprites.size; i++) {