summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/engine
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Move.java28
1 files changed, 16 insertions, 12 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Move.java b/core/src/ch/asynk/tankontank/engine/Move.java
index b12b8da..0eb3c86 100644
--- a/core/src/ch/asynk/tankontank/engine/Move.java
+++ b/core/src/ch/asynk/tankontank/engine/Move.java
@@ -42,6 +42,22 @@ public class Move extends Path implements Iterable<Vector3>
return m;
}
+ public static Move getEnter(Pawn pawn, Tile to, Orientation orientation)
+ {
+ Move m = get(pawn, null, to, orientation, null);
+ m.type = MoveType.ENTER;
+ m.cost = to.costFrom(pawn, orientation);
+ return m;
+ }
+
+ public static Move getSet(Pawn pawn, Tile to, Orientation orientation)
+ {
+ Move m = get(pawn, null, to, orientation, null);
+ m.type = MoveType.SET;
+ m.cost = 0;
+ return m;
+ }
+
public Pawn pawn;
public Tile from;
public Tile to;
@@ -86,18 +102,6 @@ public class Move extends Path implements Iterable<Vector3>
return (type != MoveType.ENTER);
}
- public void setSet()
- {
- type = MoveType.SET;
- cost = 0;
- }
-
- public void setEnter()
- {
- type = MoveType.ENTER;
- cost = to.costFrom(pawn, orientation);
- }
-
public void setExit()
{
type = MoveType.EXIT;