diff options
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hex.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java index 161ed44..c8c7361 100644 --- a/core/src/ch/asynk/tankontank/game/Hex.java +++ b/core/src/ch/asynk/tankontank/game/Hex.java @@ -1,5 +1,7 @@ package ch.asynk.tankontank.game; +import java.util.Iterator; + import com.badlogic.gdx.graphics.g2d.TextureAtlas; import ch.asynk.tankontank.engine.Pawn; @@ -82,4 +84,16 @@ public class Hex extends Tile return c; } + + @Override + public boolean hasTargetsFor(Pawn pawn) + { + if (!occupied()) return false; + + Iterator<Pawn> itr = stack.iterator(); + while(itr.hasNext()) + if (itr.next().isEnemy(pawn)) return true; + + return false; + } } |