diff options
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Order.java | 5 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Command.java | 10 |
2 files changed, 13 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Order.java b/core/src/ch/asynk/tankontank/engine/Order.java index 681bff2..47269d2 100644 --- a/core/src/ch/asynk/tankontank/engine/Order.java +++ b/core/src/ch/asynk/tankontank/engine/Order.java @@ -8,4 +8,9 @@ import com.badlogic.gdx.utils.Json; public abstract class Order implements Disposable, Pool.Poolable, Json.Serializable, Comparable<Pawn> { + public interface OrderType + { + } + + public abstract boolean isA(OrderType type); } diff --git a/core/src/ch/asynk/tankontank/game/Command.java b/core/src/ch/asynk/tankontank/game/Command.java index c310bd8..0d39e6c 100644 --- a/core/src/ch/asynk/tankontank/game/Command.java +++ b/core/src/ch/asynk/tankontank/game/Command.java @@ -8,9 +8,9 @@ import ch.asynk.tankontank.engine.Order; import ch.asynk.tankontank.engine.Move; import ch.asynk.tankontank.engine.Pawn; -public class Command extends Order +public class Command extends Order { - public enum CommandType + public enum CommandType implements Order.OrderType { NONE, MOVE, @@ -81,6 +81,12 @@ public class Command extends Order } @Override + public boolean isA(OrderType type) + { + return (type == this.type); + } + + @Override public String toString() { return String.format("%s : %s", type, unit.id); |