From dc0687557c3c1969234410ae28e8eabb1063280c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 17 Oct 2014 09:19:29 +0200 Subject: Pawn,HeadedPawn: toString return protected descr --- core/src/ch/asynk/tankontank/engine/HeadedPawn.java | 7 +------ 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 -- cgit v1.1-2-g2b99