summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Map.java27
-rw-r--r--core/src/ch/asynk/rustanddust/game/battles/MapRules.java24
2 files changed, 29 insertions, 22 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Map.java b/core/src/ch/asynk/rustanddust/game/Map.java
index 9eb3e65..4d68010 100644
--- a/core/src/ch/asynk/rustanddust/game/Map.java
+++ b/core/src/ch/asynk/rustanddust/game/Map.java
@@ -57,6 +57,9 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS
private OrderList commands;
+ public abstract void init();
+ public abstract void turnDone();
+ public abstract void actionDone();
protected abstract void setup();
protected abstract void resolveEngagement(Engagement e);
protected abstract int engagementCost(Engagement e);
@@ -368,28 +371,8 @@ public abstract class Map extends Board implements MoveToAnimationCb, ObjectiveS
return r;
}
- // Ctrl Methods
-
- public void init()
- {
- actionDone();
- }
-
- public void turnDone()
- {
- RustAndDust.debug("TurnDone", String.format(" Processed Commands : %d", commands.size()));
-
- if (objectives.modifiedCount() > 0)
- throw new RuntimeException("objectives not cleared");
-
- // FIXME do something with these Commands
- commands.dispose();
- }
-
- public void actionDone()
- {
- objectives.forget();
- }
+ protected int commandsSize() { return commands.size(); }
+ protected void commandsClear() { commands.dispose(); }
// STATES ENTRY ->
diff --git a/core/src/ch/asynk/rustanddust/game/battles/MapRules.java b/core/src/ch/asynk/rustanddust/game/battles/MapRules.java
index 3426701..89af8bd 100644
--- a/core/src/ch/asynk/rustanddust/game/battles/MapRules.java
+++ b/core/src/ch/asynk/rustanddust/game/battles/MapRules.java
@@ -14,6 +14,30 @@ abstract public class MapRules extends Map
}
@Override
+ public void init()
+ {
+ actionDone();
+ }
+
+ @Override
+ public void turnDone()
+ {
+ RustAndDust.debug("TurnDone", String.format(" Processed Commands : %d", commandsSize()));
+
+ if (objectives.modifiedCount() > 0)
+ throw new RuntimeException("objectives not cleared");
+
+ // FIXME do something with these Commands
+ commandsClear();
+ }
+
+ @Override
+ public void actionDone()
+ {
+ objectives.forget();
+ }
+
+ @Override
protected int engagementCost(Engagement e)
{
if ((activatedUnits.size() == 1) && e.attacker.isA(Unit.UnitType.AT_GUN) && e.defender.isHardTarget())