summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-09-24 23:57:37 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-09-24 23:57:37 +0200
commit703d027b301ce41ccfdd23d7a81e20ef7795a5ee (patch)
tree226f3531079de46e5ad05a29f041923b95ea2842
parentb918156a9760a440b7eb2721a2ec43e854edce51 (diff)
downloadRustAndDust-703d027b301ce41ccfdd23d7a81e20ef7795a5ee.zip
RustAndDust-703d027b301ce41ccfdd23d7a81e20ef7795a5ee.tar.gz
Pawn has overlays thatk's it
-rw-r--r--core/src/ch/asynk/tankontank/engine/Pawn.java17
1 files changed, 7 insertions, 10 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java
index b0730f1..7e58a54 100644
--- a/core/src/ch/asynk/tankontank/engine/Pawn.java
+++ b/core/src/ch/asynk/tankontank/engine/Pawn.java
@@ -28,11 +28,10 @@ public abstract class Pawn extends Image implements Disposable
public abstract int roadMarch();
public abstract boolean isEnemy(Pawn other);
- public Pawn(TextureRegion region, TextureAtlas atlas)
+ public Pawn(TextureRegion pawn, TextureAtlas overlays)
{
- super(region);
- if (atlas != null)
- this.overlays = new StackedImages(atlas);
+ super(pawn);
+ this.overlays = new StackedImages(overlays);
}
public Vector3 getLastPosition()
@@ -79,13 +78,11 @@ public abstract class Pawn extends Image implements Disposable
public boolean hasOverlayEnabled()
{
- if (overlays == null) return false;
return overlays.isEnabled();
}
public boolean enableOverlay(int i, boolean enable)
{
- if (overlays == null) return false;
overlays.enable(i, enable);
if (enable) return true;
return hasOverlayEnabled();
@@ -95,27 +92,27 @@ public abstract class Pawn extends Image implements Disposable
public void translate(float dx, float dy)
{
super.translate(dx, dy);
- if (overlays != null) overlays.translate(dx, dy);
+ overlays.translate(dx, dy);
}
@Override
public void setPosition(float x, float y, float z)
{
super.setPosition(x, y, z);
- if (overlays != null) overlays.setPosition(x, y, z);
+ overlays.setPosition(x, y, z);
}
@Override
public void draw(Batch batch)
{
super.draw(batch);
- if (overlays != null) overlays.draw(batch);
+ overlays.draw(batch);
}
@Override
public void drawDebug(ShapeRenderer debugShapes)
{
super.drawDebug(debugShapes);
- if (overlays != null) overlays.drawDebug(debugShapes);
+ overlays.drawDebug(debugShapes);
}
}