summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2020-06-30 08:52:16 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2020-06-30 08:52:16 +0200
commita03165998ad8192a8464aa6cd9be35413037566d (patch)
tree54c3e7c8189adcd204acb1bac173bbc7f33883a8 /core/src/ch
parentb1158ebbadc57ec1b52d253d1e46df18787b6bac (diff)
downloadgdx-boardgame-a03165998ad8192a8464aa6cd9be35413037566d.zip
gdx-boardgame-a03165998ad8192a8464aa6cd9be35413037566d.tar.gz
HexBoard : possibleMoves, do not blindly follow roads
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java b/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java
index acdfd9f..8ddc2e1 100644
--- a/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java
+++ b/core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java
@@ -544,7 +544,7 @@ public class HexBoard implements Board
}
}
- public int possibleMoves(Piece piece, Tile from, Collection<Tile> tiles)
+ @Override public int possibleMoves(Piece piece, Tile from, Collection<Tile> tiles)
{
tiles.clear();
searchCount += 1;
@@ -587,7 +587,7 @@ public class HexBoard implements Board
dst.roadMarch = rm;
stack.push(dst);
tiles.add(dst);
- } else if (r > dst.acc || (!dst.roadMarch && rm)) {
+ } else if (r > dst.acc || (rm && (r + roadMarchBonus > dst.acc + (dst.roadMarch ? roadMarchBonus : 0)))) {
dst.acc = r;
dst.parent = src;
dst.roadMarch = rm;