diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-02 10:24:17 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-02 10:24:17 +0100 |
commit | dcbd6d747810954e6eef169294862c0dfbddd056 (patch) | |
tree | 5c29a13906b7458cfeef837a4cfa0d60549b0e01 /core/src/ch/asynk | |
parent | eb4228baba57a85bacf870ba3532ac7fc53520b9 (diff) | |
download | RustAndDust-dcbd6d747810954e6eef169294862c0dfbddd056.zip RustAndDust-dcbd6d747810954e6eef169294862c0dfbddd056.tar.gz |
Map0Hex: implement faster int objectivesCount(Army) then the one in Board
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/map/Map0Hex.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/map/Map0Hex.java b/core/src/ch/asynk/rustanddust/game/map/Map0Hex.java index e40f58c..607a1e4 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map0Hex.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map0Hex.java @@ -58,6 +58,15 @@ public abstract class Map0Hex extends Board if (!objectives.contains(hex)) objectives.add(hex); } + + public int objectivesCount(Army army) + { + int n = 0; + for (Hex hex : objectives) { + if (hex.belongsTo(army)) + n += 1; + } + return n; } public void hexSelect(Hex hex) { selectedTile.set(hex); } |