summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust/engine
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-05-02 14:23:06 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-05-02 14:23:06 +0200
commite8924d2e7bf6c93d0d2f0c5f2d9fa72b6b9a0f95 (patch)
treee8ca8c7174e06b7d691b8e447116fcc66e9e5b0c /core/src/ch/asynk/rustanddust/engine
parent0493903c234bffcb181c441316ba5afcf961dcf4 (diff)
downloadRustAndDust-e8924d2e7bf6c93d0d2f0c5f2d9fa72b6b9a0f95.zip
RustAndDust-e8924d2e7bf6c93d0d2f0c5f2d9fa72b6b9a0f95.tar.gz
Board: add revertClaim(Pawn, Move)
Diffstat (limited to 'core/src/ch/asynk/rustanddust/engine')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/Board.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/Board.java b/core/src/ch/asynk/rustanddust/engine/Board.java
index 1bc11c9..ace94d6 100644
--- a/core/src/ch/asynk/rustanddust/engine/Board.java
+++ b/core/src/ch/asynk/rustanddust/engine/Board.java
@@ -440,13 +440,21 @@ public abstract class Board implements Disposable, Animation
}
}
- public void revertclaim(Pawn pawn, Tile tile)
+ public void revertClaim(Pawn pawn, Tile tile)
{
int o = pawn.getTile().revertClaim().overlay();
tile.enableOverlay(pawn.getFaction().overlay(), false);
enableOverlayOn(tile ,o, true);
}
+ public void revertClaim(Pawn pawn, Move move)
+ {
+ revertClaim(pawn, move.to);
+ for (Tile tile : move.tiles)
+ revertClaim(pawn, tile);
+ claim(pawn, move.from);
+ }
+
public void enableOverlayOn(Tile tile, int i, boolean enable)
{
if (tile.enableOverlay(i, enable))