summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-22 12:04:53 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-22 12:04:53 +0200
commit6b75f8772de1783643ca7825226b1a6b844793ac (patch)
treef27454a0a65fa94a9e9c65f43d314f389aefcf0b /core/src/ch/asynk/tankontank/game
parent66daac0daac4016c61a88bdcb2723976f5848b69 (diff)
downloadRustAndDust-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')
-rw-r--r--core/src/ch/asynk/tankontank/game/Hex.java6
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/Factory.java4
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateCommon.java2
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)