diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-13 12:09:09 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-13 12:09:09 +0200 |
commit | 01e97d0b06ce12e71ad61d596f8f54a6ed99254e (patch) | |
tree | 9b1d0b591a079c42e522214da247baf5bf314003 /core | |
parent | 24f64fb32ebd7dadbfbe19e097619b0496b4af79 (diff) | |
download | RustAndDust-01e97d0b06ce12e71ad61d596f8f54a6ed99254e.zip RustAndDust-01e97d0b06ce12e71ad61d596f8f54a6ed99254e.tar.gz |
Map: add boolean toggleAttackAssist(Pawn)
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 13 |
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 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); |