diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-30 17:31:37 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-30 17:31:37 +0200 |
commit | 49a39415a4f51799ec2272fde507981653c9b3c6 (patch) | |
tree | 1bd01350b14effa482039261ce27fb7602724eb6 /core/src/ch/asynk/tankontank/game | |
parent | b0d3dadc59d25fdd2bc85943c64c68615a074553 (diff) | |
download | RustAndDust-49a39415a4f51799ec2272fde507981653c9b3c6.zip RustAndDust-49a39415a4f51799ec2272fde507981653c9b3c6.tar.gz |
Tile: occupied() -> isEmpty() && hasUnits()
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hex.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java index 4e07492..238f47a 100644 --- a/core/src/ch/asynk/tankontank/game/Hex.java +++ b/core/src/ch/asynk/tankontank/game/Hex.java @@ -44,7 +44,7 @@ public class Hex extends Tile @Override public boolean blockLineOfSightFrom(Tile tile) { - if ((terrain == Terrain.CLEAR) && !occupied()) + if ((terrain == Terrain.CLEAR) && !hasUnits()) return false; if ((((Hex) tile).terrain == Terrain.HILLS) && (terrain == Terrain.CLEAR)) @@ -56,7 +56,7 @@ public class Hex extends Tile @Override public boolean atLeastOneMove(Pawn pawn) { - if (occupied() || (terrain == Terrain.BLOCKED) || (terrain == Terrain.OFFMAP)) + if (hasUnits() || (terrain == Terrain.BLOCKED) || (terrain == Terrain.OFFMAP)) return false; return true; } @@ -70,7 +70,7 @@ public class Hex extends Tile @Override public int costFrom(Pawn pawn, Board.Orientation side, boolean road) { - if (occupied()) return Integer.MAX_VALUE; + if (hasUnits()) return Integer.MAX_VALUE; if (road) return 1; int c = 0; @@ -95,7 +95,7 @@ public class Hex extends Tile @Override public boolean hasTargetsFor(Pawn pawn) { - if (!occupied()) return false; + if (!hasUnits()) return false; Iterator<Pawn> itr = stack.iterator(); while(itr.hasNext()) |