summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-01-18 23:22:27 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-01-18 23:22:27 +0100
commit828f856a9b6aed935fe8e50a892bb6dec7aaceb0 (patch)
tree09ec69b3eec17dad0c15897dca46908835104a8f /core/src/ch
parent0eb2eae843b58fe45883b96874dc876a074df250 (diff)
downloadRustAndDust-828f856a9b6aed935fe8e50a892bb6dec7aaceb0.zip
RustAndDust-828f856a9b6aed935fe8e50a892bb6dec7aaceb0.tar.gz
PossiblePaths: add getExitMove()
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Move.java5
-rw-r--r--core/src/ch/asynk/tankontank/engine/PossiblePaths.java7
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java5
3 files changed, 8 insertions, 9 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Move.java b/core/src/ch/asynk/tankontank/engine/Move.java
index 0eb3c86..16a0860 100644
--- a/core/src/ch/asynk/tankontank/engine/Move.java
+++ b/core/src/ch/asynk/tankontank/engine/Move.java
@@ -102,11 +102,6 @@ public class Move extends Path implements Iterable<Vector3>
return (type != MoveType.ENTER);
}
- public void setExit()
- {
- type = MoveType.EXIT;
- }
-
public int steps()
{
int steps = 0;
diff --git a/core/src/ch/asynk/tankontank/engine/PossiblePaths.java b/core/src/ch/asynk/tankontank/engine/PossiblePaths.java
index 1dbb12b..f45b3ac 100644
--- a/core/src/ch/asynk/tankontank/engine/PossiblePaths.java
+++ b/core/src/ch/asynk/tankontank/engine/PossiblePaths.java
@@ -200,6 +200,13 @@ public class PossiblePaths implements Disposable
return Move.get(pawn, from, to, orientation, getPath(0));
}
+ public Move getExitMove()
+ {
+ Move move = getMove();
+ move.type = Move.MoveType.EXIT;
+ return move;
+ }
+
public Path getPath(int i)
{
if (ctrlTiles.size() == 0)
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 7a28a70..35a4325 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -295,10 +295,7 @@ public abstract class Map extends Board
// unit.reset();
// }
- Move move = possiblePaths.getMove();
- move.setExit();
-
- movePawn(unit, move, notifyDoneAnimation(unit), objectives);
+ movePawn(unit, possiblePaths.getExitMove(), notifyDoneAnimation(unit), objectives);
return startMove(unit);
}