diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Command.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Command.java b/core/src/ch/asynk/tankontank/game/Command.java index be4540f..1f79589 100644 --- a/core/src/ch/asynk/tankontank/game/Command.java +++ b/core/src/ch/asynk/tankontank/game/Command.java @@ -37,6 +37,7 @@ public class Command extends Order public Player player; public Unit unit; public Move move; + public Engagement engagement; private Command() { @@ -59,6 +60,10 @@ public class Command extends Order this.move.dispose(); this.move = null; } + if (this.engagement != null) { + this.engagement.dispose(); + this.engagement = null; + } } @Override @@ -80,6 +85,13 @@ public class Command extends Order this.unit = unit; } + public void setEngage(Unit unit, Unit target) + { + this.type = CommandType.ENGAGE; + this.unit = unit; + this.engagement = Engagement.get(unit, target); + } + @Override public void write(Json json) { |