diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-11-05 14:30:34 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-11-05 14:30:34 +0100 |
commit | d17e8e8d9a127cc15ae16a2fe86b0a5e557e3eae (patch) | |
tree | 149f1ea6e778492cafcded6a5ec4b283122a90bc /core | |
parent | 9ef6e1b0bb5e8d8098b2be7daae7e77e4dab55d5 (diff) | |
download | RustAndDust-d17e8e8d9a127cc15ae16a2fe86b0a5e557e3eae.zip RustAndDust-d17e8e8d9a127cc15ae16a2fe86b0a5e557e3eae.tar.gz |
add and use Pawn.canBreak()
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/Pawn.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Map.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Unit.java | 6 |
3 files changed, 8 insertions, 1 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/Pawn.java b/core/src/ch/asynk/rustanddust/engine/Pawn.java index f21c9b9..704b782 100644 --- a/core/src/ch/asynk/rustanddust/engine/Pawn.java +++ b/core/src/ch/asynk/rustanddust/engine/Pawn.java @@ -61,6 +61,7 @@ public abstract class Pawn implements Moveable, Disposable public abstract boolean canRotate(); public abstract boolean canEngage(); public abstract boolean canEngage(Pawn other); + public abstract boolean canBreak(); public abstract boolean canAssistEngagementWithoutLos(); public abstract void move(); diff --git a/core/src/ch/asynk/rustanddust/game/Map.java b/core/src/ch/asynk/rustanddust/game/Map.java index e4f44e6..35497ff 100644 --- a/core/src/ch/asynk/rustanddust/game/Map.java +++ b/core/src/ch/asynk/rustanddust/game/Map.java @@ -556,7 +556,7 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS for (Unit u : activatedUnits) { u.engage(); - if (u.isA(Unit.UnitType.INFANTRY)) + if (u.canBreak()) breakUnits.add(u); } diff --git a/core/src/ch/asynk/rustanddust/game/Unit.java b/core/src/ch/asynk/rustanddust/game/Unit.java index 36e6a69..ec259c1 100644 --- a/core/src/ch/asynk/rustanddust/game/Unit.java +++ b/core/src/ch/asynk/rustanddust/game/Unit.java @@ -293,6 +293,12 @@ public class Unit extends HeadedPawn return (isEnemy(other) && canEngage()); } + @Override + public boolean canBreak() + { + return isA(UnitType.INFANTRY); + } + public boolean canHQMove() { return (isHq() && ((move == null) || (!move.isEnter()))); |