summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-08 11:21:06 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-08 11:21:06 +0200
commit0bcbf473a5ffc5bbfc1356f7a15ae90f98f57bc2 (patch)
tree94ddb71ad3b69e801e9f0d5d271a0632b88a81ad /core
parentb0ea77774e60f03126499aad8e5234b8fd6f12da (diff)
downloadRustAndDust-0bcbf473a5ffc5bbfc1356f7a15ae90f98f57bc2.zip
RustAndDust-0bcbf473a5ffc5bbfc1356f7a15ae90f98f57bc2.tar.gz
GameState*: update
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/states/GameStateRotate.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/states/GameStateSelect.java31
2 files changed, 12 insertions, 21 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java b/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java
index 661efa7..17e40f2 100644
--- a/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java
+++ b/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java
@@ -7,7 +7,7 @@ public class GameStateRotate extends GameStateCommon
@Override
public void enter()
{
- map.hidePossibles();
+ showPossibleTargetsMovesAssists(false);
if (hasPawn()) {
selectHex(hex);
map.enableDirections(hex, true);
diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateSelect.java b/core/src/ch/asynk/tankontank/game/states/GameStateSelect.java
index dd94b0f..be96afd 100644
--- a/core/src/ch/asynk/tankontank/game/states/GameStateSelect.java
+++ b/core/src/ch/asynk/tankontank/game/states/GameStateSelect.java
@@ -24,32 +24,23 @@ public class GameStateSelect extends GameStateCommon
@Override
public void touchUp()
{
+ int moves = 0;
+ int targets = 0;
+ int assists = 0;
+ showPossibleTargetsMovesAssists(false);
if (hasPawn()) {
- if (ctrl.cfg.showMoves) map.enablePossibleMoves(false);
- if (ctrl.cfg.showTargets) map.enablePossibleTargets(false);
- if (ctrl.cfg.showMoveAssists) map.enableMoveAssists(false);
- map.buildPossibleMoves(pawn, hex);
- map.buildPossibleTargets(pawn, hex);
- map.buildMoveAssists(pawn, hex);
- if (ctrl.cfg.showMoves) map.enablePossibleMoves(true);
- if (ctrl.cfg.showTargets) map.enablePossibleTargets(true);
- if (ctrl.cfg.showMoveAssists) map.enableMoveAssists(true);
- } else {
- clear();
- }
+ moves = map.buildPossibleMoves(pawn, hex);
+ targets = map.buildPossibleTargets(pawn, hex);
+ assists = map.buildMoveAssists(pawn, hex);
+ showPossibleTargetsMovesAssists(true);
+ } else
+ map.clearPossibleTargetsMovesAssists();
}
@Override
public void abort()
{
- clear();
+ showPossibleTargetsMovesAssists(false);
super.abort();
}
-
- private void clear()
- {
- map.enablePossibleMoves(false);
- map.enablePossibleTargets(false);
- map.enableMoveAssists(false);
- }
}