From 47bfaa56133d1b540fbea31450bece41b5f4fe94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 18 Feb 2015 17:52:50 +0100 Subject: Command: support engagement --- core/src/ch/asynk/tankontank/game/Command.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) { -- cgit v1.1-2-g2b99