diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-11 23:39:34 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-11 23:39:34 +0200 |
commit | 4c41183bc9a8ce115da1743a5648f59b1fe71d6e (patch) | |
tree | 0ee880b1db71170cc2e4e6e59e64e5851515c298 /core/src/ch | |
parent | ea0c1e1acac5ed08873ce6ed1dd66cd46a381ca5 (diff) | |
download | RustAndDust-4c41183bc9a8ce115da1743a5648f59b1fe71d6e.zip RustAndDust-4c41183bc9a8ce115da1743a5648f59b1fe71d6e.tar.gz |
Pawn: add toString()
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index 9a2fcc1..a3b0a26 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -26,6 +26,7 @@ public abstract class Pawn implements Drawable, Disposable private Vector3 position = new Vector3(0f, 0f, 0f); private Vector3 prevPosition = new Vector3(0f, 0f, 0f); + private String name; private Image image; private StackedImages overlays; @@ -54,13 +55,20 @@ public abstract class Pawn implements Drawable, Disposable { } - public Pawn(TextureAtlas atlas, String pawn) + public Pawn(TextureAtlas atlas, String name) { - image = new Image(atlas.findRegion(pawn)); + this.name = name; + this.image = new Image(atlas.findRegion(name)); this.overlays = new StackedImages(atlas); } @Override + public String toString() + { + return name; + } + + @Override public void dispose() { image.dispose(); |