From 01e97d0b06ce12e71ad61d596f8f54a6ed99254e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 13 Oct 2014 12:09:09 +0200 Subject: Map: add boolean toggleAttackAssist(Pawn) --- core/src/ch/asynk/tankontank/game/Map.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 5c50ea5..e5764f0 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -212,6 +212,19 @@ public abstract class Map extends Board return attackAssists.size(); } + public boolean toggleAttackAssist(Pawn pawn) + { + if (activablePawns.contains(pawn)) { + activablePawns.remove(pawn); + activatedPawns.add(pawn); + return true; + } else { + activatedPawns.remove(pawn); + activablePawns.add(pawn); + return false; + } + } + public void buildAndShowMovesAndAssits(Pawn pawn, GridPoint2 hex) { showPossibleMoves(false); -- cgit v1.1-2-g2b99