summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-05-02 11:00:37 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-05-02 11:00:37 +0200
commitbf449f3459d17c83be3f8e82edaec72da0865c32 (patch)
treeea8e0a922d2101bce61f61cc69e73835256f7d45 /core/src/ch/asynk
parent7ccc8701b4b02cc6fa0fd5e69afac58240593b92 (diff)
downloadRustAndDust-bf449f3459d17c83be3f8e82edaec72da0865c32.zip
RustAndDust-bf449f3459d17c83be3f8e82edaec72da0865c32.tar.gz
Pawn,Hex: road(Orientation) -> roadFrom(Orientation)
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/Board.java2
-rw-r--r--core/src/ch/asynk/rustanddust/engine/PathBuilder.java6
-rw-r--r--core/src/ch/asynk/rustanddust/engine/SearchBoard.java4
-rw-r--r--core/src/ch/asynk/rustanddust/engine/Tile.java2
-rw-r--r--core/src/ch/asynk/rustanddust/game/Hex.java4
5 files changed, 9 insertions, 9 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/Board.java b/core/src/ch/asynk/rustanddust/engine/Board.java
index 36a4926..f1e1583 100644
--- a/core/src/ch/asynk/rustanddust/engine/Board.java
+++ b/core/src/ch/asynk/rustanddust/engine/Board.java
@@ -383,7 +383,7 @@ public abstract class Board implements Disposable, Animation
Orientation o = Orientation.fromAdj(t.col, t.row, to.col, to.row);
if (o.isInSides(allowedMoves)) {
o = o.opposite();
- boolean r = to.road(o);
+ boolean r = to.roadFrom(o);
int c = to.costFrom(pawn, o);
if ((c < cost) || (r && (c == cost))) {
entry = o;
diff --git a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
index f85a036..edac1c3 100644
--- a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
+++ b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
@@ -156,7 +156,7 @@ public class PathBuilder implements Disposable
Path good = ps.get(0);
int mvt = pawn.getMovementPoints();
int cost = to.exitCost();
- int rBonus = (to.road(o) ? pawn.getRoadMarchBonus() : 0);
+ int rBonus = (to.roadFrom(o) ? pawn.getRoadMarchBonus() : 0);
if (ps.size() > 1) {
good = null;
@@ -215,7 +215,7 @@ public class PathBuilder implements Disposable
Orientation o = board.getSide(i);
int m = (mvtLeft - next.costFrom(pawn, o));
int f = (fitness + (next.isObjectiveFor(pawn) ? 1 : 0));
- boolean r = (roadMarch && next.road(o));
+ boolean r = (roadMarch && next.roadFrom(o));
int l = (m + (r ? pawn.getRoadMarchBonus() : 0));
@@ -305,7 +305,7 @@ public class PathBuilder implements Disposable
{
int mvt = pawn.getMovementPoints();
int cost = to.exitCost();
- int rBonus = (to.road(o) ? pawn.getRoadMarchBonus() : 0);
+ int rBonus = (to.roadFrom(o) ? pawn.getRoadMarchBonus() : 0);
for (Path p : getPaths()) {
if (pathCanExit(p, mvt, cost, rBonus))
diff --git a/core/src/ch/asynk/rustanddust/engine/SearchBoard.java b/core/src/ch/asynk/rustanddust/engine/SearchBoard.java
index 803214e..01f6101 100644
--- a/core/src/ch/asynk/rustanddust/engine/SearchBoard.java
+++ b/core/src/ch/asynk/rustanddust/engine/SearchBoard.java
@@ -149,7 +149,7 @@ public class SearchBoard
int cost = t.costFrom(pawn, board.getSide(i));
boolean mayMoveOne = first && t.atLeastOneMove(pawn);
int r = src.remaining - cost;
- boolean roadMarch = (src.roadMarch && t.road(board.getSide(i)));
+ boolean roadMarch = (src.roadMarch && t.roadFrom(board.getSide(i)));
if (dst.search == searchCount) {
if ((r >= 0) && ((r > dst.remaining) || (roadMarch && ((r + roadMarchBonus) >= dst.remaining)))) {
@@ -188,7 +188,7 @@ public class SearchBoard
if (dst != null) {
Tile t = getTile(dst);
- if (!t.road(board.getSide(i)))
+ if (!t.roadFrom(board.getSide(i)))
continue;
int cost = t.costFrom(pawn, board.getSide(i));
int r = src.remaining - cost;
diff --git a/core/src/ch/asynk/rustanddust/engine/Tile.java b/core/src/ch/asynk/rustanddust/engine/Tile.java
index 0fc3b10..9b7003d 100644
--- a/core/src/ch/asynk/rustanddust/engine/Tile.java
+++ b/core/src/ch/asynk/rustanddust/engine/Tile.java
@@ -43,7 +43,7 @@ public abstract class Tile implements Drawable, Disposable, Iterable<Pawn>
public abstract boolean isOffMap();
public abstract boolean isA(TileTerrain terrain);
- public abstract boolean road(Orientation side);
+ public abstract boolean roadFrom(Orientation side);
public abstract boolean atLeastOneMove(Pawn pawn);
public abstract boolean blockLineOfSight(Tile from, Tile to);
diff --git a/core/src/ch/asynk/rustanddust/game/Hex.java b/core/src/ch/asynk/rustanddust/game/Hex.java
index 7b37dee..34ccdb3 100644
--- a/core/src/ch/asynk/rustanddust/game/Hex.java
+++ b/core/src/ch/asynk/rustanddust/game/Hex.java
@@ -88,7 +88,7 @@ public class Hex extends Tile
}
@Override
- public boolean road(Orientation side)
+ public boolean roadFrom(Orientation side)
{
return (side.s == (roads & side.s));
}
@@ -104,7 +104,7 @@ public class Hex extends Tile
{
if (side == Orientation.KEEP) return 0;
if (hasUnits()) return (Integer.MAX_VALUE / 2);
- if (road(side)) return 1;
+ if (roadFrom(side)) return 1;
int c = 0;
switch(terrain) {