diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-22 12:04:53 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-22 12:04:53 +0200 |
commit | 6b75f8772de1783643ca7825226b1a6b844793ac (patch) | |
tree | f27454a0a65fa94a9e9c65f43d314f389aefcf0b /core/src/ch/asynk/tankontank/game | |
parent | 66daac0daac4016c61a88bdcb2723976f5848b69 (diff) | |
download | RustAndDust-6b75f8772de1783643ca7825226b1a6b844793ac.zip RustAndDust-6b75f8772de1783643ca7825226b1a6b844793ac.tar.gz |
Tile: replace Vector2 center with int col, row; float x, y;
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
4 files changed, 7 insertions, 7 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java index 84b2a34..e5a61d4 100644 --- a/core/src/ch/asynk/tankontank/game/Hex.java +++ b/core/src/ch/asynk/tankontank/game/Hex.java @@ -35,12 +35,12 @@ public class Hex extends Tile public String toString() { - return "[" + getCenter().x + ";" + getCenter().y + "] " + "t:" + terrain + " r:" + roads; + return "(" + col + ";" + row + ") [" + x + ";" + y + "] " + "t:" + terrain + " r:" + roads; } - public Hex(float x, float y, TextureAtlas atlas) + public Hex(float x, float y, int col, int row, TextureAtlas atlas) { - super(x, y, atlas); + super(x, y, col, row, atlas); this.terrain = Terrain.CLEAR; this.roads = 0; } diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index c0b799d..68c3b12 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -92,7 +92,7 @@ public abstract class Map extends Board return (Hex) getTile(col, row); } - protected Hex getHexSafe(GridPoint2 hex) + public Hex getHexSafe(GridPoint2 hex) { return (Hex) getTileSafe(hex.x, hex.y); } diff --git a/core/src/ch/asynk/tankontank/game/battles/Factory.java b/core/src/ch/asynk/tankontank/game/battles/Factory.java index f753d47..8ab3ba8 100644 --- a/core/src/ch/asynk/tankontank/game/battles/Factory.java +++ b/core/src/ch/asynk/tankontank/game/battles/Factory.java @@ -149,8 +149,8 @@ public class Factory implements Board.TileBuilder, Disposable return u; } - public Hex getNewTile(float cx, float cy) + public Hex getNewTile(float x, float y, int col, int row) { - return new Hex(cx, cy, atlas); + return new Hex(x, y, col, row, atlas); } } diff --git a/core/src/ch/asynk/tankontank/game/states/StateCommon.java b/core/src/ch/asynk/tankontank/game/states/StateCommon.java index e729a84..2edda2c 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateCommon.java +++ b/core/src/ch/asynk/tankontank/game/states/StateCommon.java @@ -113,7 +113,7 @@ public abstract class StateCommon implements State isEnemy = ctrl.player.isEnemy(selectedPawn); else isEnemy = false; - System.err.println(" select (" + selectedHex.x + ";" + selectedHex.y + ") " + selectedPawn + (isEnemy ? " enemy " : " friend ")); + System.err.println(" select " + map.getHexSafe(selectedHex) + selectedPawn + (isEnemy ? " enemy " : " friend ")); } protected void showPossibleTargetsMovesAssists(Pawn pawn) |