diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-18 23:22:01 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-18 23:22:01 +0100 |
commit | 0eb2eae843b58fe45883b96874dc876a074df250 (patch) | |
tree | 02504de5aa384283470972ac0478dfc81ecf44ad /core/src/ch/asynk/tankontank/engine | |
parent | 05968c6347a66d62767d1bc49f1a7799b3b5cd00 (diff) | |
download | RustAndDust-0eb2eae843b58fe45883b96874dc876a074df250.zip RustAndDust-0eb2eae843b58fe45883b96874dc876a074df250.tar.gz |
Move: add static getEnter() and getSet()
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Move.java | 28 |
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; |