diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-17 09:19:29 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-17 09:19:29 +0200 |
commit | dc0687557c3c1969234410ae28e8eabb1063280c (patch) | |
tree | 30e1b57ae8dc2236c7c89f74d878fdea825192e3 /core | |
parent | 8c67a8de75d61200bc4f1cda01ec617d9bf75cd2 (diff) | |
download | RustAndDust-dc0687557c3c1969234410ae28e8eabb1063280c.zip RustAndDust-dc0687557c3c1969234410ae28e8eabb1063280c.tar.gz |
Pawn,HeadedPawn: toString return protected descr
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/HeadedPawn.java | 7 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 6 |
2 files changed, 4 insertions, 9 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/HeadedPawn.java b/core/src/ch/asynk/tankontank/engine/HeadedPawn.java index ca08e26..a42f699 100644 --- a/core/src/ch/asynk/tankontank/engine/HeadedPawn.java +++ b/core/src/ch/asynk/tankontank/engine/HeadedPawn.java @@ -19,12 +19,7 @@ public abstract class HeadedPawn extends Pawn super(atlas, pawn); this.head = new Image(atlas.findRegion(head)); this.orientation = Orientation.KEEP; - } - - @Override - public String toString() - { - return super.toString() + " " + orientation; + this.descr += " " + orientation; } @Override diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index d646915..197fde4 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -34,7 +34,7 @@ public abstract class Pawn implements Moveable, Disposable private Vector3 position = new Vector3(0f, 0f, 0f); private Vector3 prevPosition = new Vector3(0f, 0f, 0f); - private String name; + protected String descr; private Image image; private StackedImages overlays; public Attack attack = new Attack(); @@ -69,7 +69,7 @@ public abstract class Pawn implements Moveable, Disposable public Pawn(TextureAtlas atlas, String name) { - this.name = name; + this.descr = descr; this.image = new Image(atlas.findRegion(name)); this.overlays = new StackedImages(atlas); } @@ -77,7 +77,7 @@ public abstract class Pawn implements Moveable, Disposable @Override public String toString() { - return name; + return descr; } @Override |