diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-18 17:12:16 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-18 17:12:16 +0100 |
commit | 66f490fedf3545bc0a239d466d85d3d1a71feac6 (patch) | |
tree | 66863bdc726d8ff42aea70cc04e7afdbbf666379 | |
parent | c2b247ae75d4825b33a5b328c9ef62952b5bfaa1 (diff) | |
download | RustAndDust-66f490fedf3545bc0a239d466d85d3d1a71feac6.zip RustAndDust-66f490fedf3545bc0a239d466d85d3d1a71feac6.tar.gz |
Hex: use String.format for toString(), add toShort()
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hex.java | 7 |
1 files changed, 6 insertions, 1 deletions
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) |