summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-02-18 17:52:50 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-02-18 17:52:50 +0100
commit47bfaa56133d1b540fbea31450bece41b5f4fe94 (patch)
treef3cb4b10282ad6cf4cbecd2e631420e568e81e05 /core/src
parentc495a7ef6ae46304ca6e59833e48d0d70a2c6800 (diff)
downloadRustAndDust-47bfaa56133d1b540fbea31450bece41b5f4fe94.zip
RustAndDust-47bfaa56133d1b540fbea31450bece41b5f4fe94.tar.gz
Command: support engagement
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/tankontank/game/Command.java12
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)
{