summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-01-04 12:21:56 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-01-04 12:21:56 +0100
commitd4944b8655e8a5ec72c2f35671541a62ace993dc (patch)
treef19d7025c3fbd01d7ceba3fb300b6f5f412c8c4d
parent77714a9d5cb226889e820279f73e3444a38a17f3 (diff)
downloadRustAndDust-d4944b8655e8a5ec72c2f35671541a62ace993dc.zip
RustAndDust-d4944b8655e8a5ec72c2f35671541a62ace993dc.tar.gz
PathBuilder: shorten code
-rw-r--r--core/src/ch/asynk/rustanddust/engine/PathBuilder.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
index 16c2f86..af5d78b 100644
--- a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
+++ b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
@@ -145,12 +145,9 @@ public class PathBuilder implements Disposable
if ((next == null) || next.isOffMap()) continue;
Orientation o = board.getSide(i);
- int n = next.costFrom(pawn, o);
- boolean r = next.road(o);
+ int m = (mvtLeft - next.costFrom(pawn, o));
int f = (fitness + (next.isObjectiveFor(pawn) ? 1 : 0));
-
- int m = (mvtLeft - n);
- r &= roadMarch;
+ boolean r = (roadMarch && next.road(o));
int l = (m + (r ? pawn.getRoadMarchBonus() : 0));