From e8924d2e7bf6c93d0d2f0c5f2d9fa72b6b9a0f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 2 May 2016 14:23:06 +0200 Subject: Board: add revertClaim(Pawn, Move) --- core/src/ch/asynk/rustanddust/engine/Board.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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)) -- cgit v1.1-2-g2b99