summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/Pawn.java1
-rw-r--r--core/src/ch/asynk/rustanddust/game/Map.java2
-rw-r--r--core/src/ch/asynk/rustanddust/game/Unit.java6
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())));