summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-05 17:14:35 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-05 17:14:35 +0100
commitb9937afafd957346f8471f483bdde7e900093075 (patch)
tree4915f20aa268b5c7cc0ee82b5fbd49a9618dd966 /core
parente21ec55eb6d382fff6741abbb7e5bc192d5b700f (diff)
downloadRustAndDust-b9937afafd957346f8471f483bdde7e900093075.zip
RustAndDust-b9937afafd957346f8471f483bdde7e900093075.tar.gz
Map: add enterBoard(Pawn, Hex, Orientation) and leaveBoard(Pawn)
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 66fa17c..351fd46 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -167,6 +167,19 @@ public abstract class Map extends Board
// ACTIONS
+ public void enterBoard(Pawn pawn, Hex to, Orientation o)
+ {
+ Orientation entry = findBestEntry(pawn, to, o);
+ pawn.enterBoard(to, entry);
+ setPawnOnto(pawn, to, o);
+ }
+
+ public void leaveBoard(Pawn pawn)
+ {
+ removePawn(pawn);
+ pawn.reset();
+ }
+
public void promote(Pawn pawn, Pawn with)
{
removePawn(pawn);