summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-02-18 21:22:00 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-02-18 21:22:00 +0100
commit50c7bb777aa3608a359d196fe26ef2cdd63db76d (patch)
tree42ca664cadfbcf4eec498766086d7b2ba9484a08 /core/src/ch/asynk/tankontank/game
parent13bac1f16fb2706320943a397bdd2ffdf9aaba71 (diff)
downloadRustAndDust-50c7bb777aa3608a359d196fe26ef2cdd63db76d.zip
RustAndDust-50c7bb777aa3608a359d196fe26ef2cdd63db76d.tar.gz
Command: implements Comparable<Pawn>
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/Command.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Command.java b/core/src/ch/asynk/tankontank/game/Command.java
index 1f79589..1ac1bb5 100644
--- a/core/src/ch/asynk/tankontank/game/Command.java
+++ b/core/src/ch/asynk/tankontank/game/Command.java
@@ -6,6 +6,7 @@ import com.badlogic.gdx.utils.JsonValue;
import ch.asynk.tankontank.engine.Order;
import ch.asynk.tankontank.engine.Move;
+import ch.asynk.tankontank.engine.Pawn;
public class Command extends Order
{
@@ -67,6 +68,14 @@ public class Command extends Order
}
@Override
+ public int compareTo(Pawn pawn)
+ {
+ if (pawn == unit)
+ return 0;
+ return 1;
+ }
+
+ @Override
public String toString()
{
return String.format("%s : %s", type, unit.id);