diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2020-06-30 08:52:16 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2020-06-30 08:52:16 +0200 |
commit | a03165998ad8192a8464aa6cd9be35413037566d (patch) | |
tree | 54c3e7c8189adcd204acb1bac173bbc7f33883a8 /core/src/ch/asynk/gdx/boardgame/boards | |
parent | b1158ebbadc57ec1b52d253d1e46df18787b6bac (diff) | |
download | gdx-boardgame-a03165998ad8192a8464aa6cd9be35413037566d.zip gdx-boardgame-a03165998ad8192a8464aa6cd9be35413037566d.tar.gz |
HexBoard : possibleMoves, do not blindly follow roads
Diffstat (limited to 'core/src/ch/asynk/gdx/boardgame/boards')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/boards/HexBoard.java | 4 |
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; |