From 66f490fedf3545bc0a239d466d85d3d1a71feac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 18 Dec 2014 17:12:16 +0100 Subject: Hex: use String.format for toString(), add toShort() --- core/src/ch/asynk/tankontank/game/Hex.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java index 6e89df4..5fa1ee6 100644 --- a/core/src/ch/asynk/tankontank/game/Hex.java +++ b/core/src/ch/asynk/tankontank/game/Hex.java @@ -39,7 +39,12 @@ public class Hex extends Tile public String toString() { - return "(" + col + ";" + row + ") [" + x + ";" + y + "] " + "t:" + terrain + " r:" + roads; + return String.format("(%d;%d) [%f;%f] t:%s r:%d", col, row, x, y, terrain, roads); + } + + public String toShort() + { + return String.format("(%d;%d)", col, row); } public Hex(float x, float y, int col, int row, TextureAtlas atlas) -- cgit v1.1-2-g2b99