diff options
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Move.java | 14 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Pawn.java | 8 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Unit.java | 4 |
3 files changed, 18 insertions, 8 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Move.java b/core/src/ch/asynk/tankontank/engine/Move.java index 2f0c138..06035c3 100644 --- a/core/src/ch/asynk/tankontank/engine/Move.java +++ b/core/src/ch/asynk/tankontank/engine/Move.java @@ -98,12 +98,22 @@ public class Move extends Path implements Iterable<Vector3> movePool.free(this); } - public boolean isEntry() + public boolean isSet() + { + return (type == MoveType.SET); + } + + public boolean isEnter() { return (type == MoveType.ENTER); } - public boolean isComplete() + public boolean isRegular() + { + return (type == MoveType.REGULAR); + } + + public boolean isFinal() { return (type != MoveType.ENTER); } diff --git a/core/src/ch/asynk/tankontank/engine/Pawn.java b/core/src/ch/asynk/tankontank/engine/Pawn.java index 7e0f9da..b471406 100644 --- a/core/src/ch/asynk/tankontank/engine/Pawn.java +++ b/core/src/ch/asynk/tankontank/engine/Pawn.java @@ -113,11 +113,11 @@ public abstract class Pawn implements Moveable, Disposable public void move(Move move) { - if (move.isEntry()) + if (move.isEnter()) throw new RuntimeException("wrong MoveType"); if (this.move != null) { - if (this.move.isEntry()) + if (this.move.isEnter()) this.move.dispose(); else throw new RuntimeException("try to override an existing move instance"); @@ -128,7 +128,7 @@ public abstract class Pawn implements Moveable, Disposable public void enter(Move move) { - if (!move.isEntry()) + if (!move.isEnter()) throw new RuntimeException("wrong MoveType"); if (this.move != null) @@ -152,7 +152,7 @@ public abstract class Pawn implements Moveable, Disposable public boolean justEntered() { - return ((move != null) && move.isEntry()); + return ((move != null) && move.isEnter()); } public boolean is(Faction faction) diff --git a/core/src/ch/asynk/tankontank/game/Unit.java b/core/src/ch/asynk/tankontank/game/Unit.java index 6105637..a488633 100644 --- a/core/src/ch/asynk/tankontank/game/Unit.java +++ b/core/src/ch/asynk/tankontank/game/Unit.java @@ -286,7 +286,7 @@ public class Unit extends HeadedPawn public boolean canHQMove() { - return (isHq() && ((move == null) || (!move.isEntry()))); + return (isHq() && ((move == null) || (!move.isEnter()))); } public void setMoved() @@ -306,7 +306,7 @@ public class Unit extends HeadedPawn if (cost > mpLeft) TankOnTank.debug("ERROR: Movement point exceeded: " + cost + "/" + mpLeft + " please report"); - if (move.isComplete()) + if (move.isFinal()) setMoved(); mpLeft -= cost; |