diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-05-02 14:23:06 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-05-02 14:23:06 +0200 |
commit | e8924d2e7bf6c93d0d2f0c5f2d9fa72b6b9a0f95 (patch) | |
tree | e8ca8c7174e06b7d691b8e447116fcc66e9e5b0c | |
parent | 0493903c234bffcb181c441316ba5afcf961dcf4 (diff) | |
download | RustAndDust-e8924d2e7bf6c93d0d2f0c5f2d9fa72b6b9a0f95.zip RustAndDust-e8924d2e7bf6c93d0d2f0c5f2d9fa72b6b9a0f95.tar.gz |
Board: add revertClaim(Pawn, Move)
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/Board.java | 10 |
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)) |