summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-30 00:22:37 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-30 00:22:37 +0100
commitdf4ea901cc67c389d9327634622a2e83c606a7ce (patch)
treef69a2a2174d9038a19051c007daec8311aae19eb /core/src
parent8ce0d341aa7aa67cb2223169e9ba3e0cd8b0c97d (diff)
downloadRustAndDust-df4ea901cc67c389d9327634622a2e83c606a7ce.zip
RustAndDust-df4ea901cc67c389d9327634622a2e83c606a7ce.tar.gz
ObjectiveSet,Map,Hex: visualy differenciate objectives that has to be hold and the others
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/tankontank/game/Hex.java7
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java12
-rw-r--r--core/src/ch/asynk/tankontank/game/ObjectiveSet.java2
3 files changed, 10 insertions, 11 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java
index 0abd9d6..6e89df4 100644
--- a/core/src/ch/asynk/tankontank/game/Hex.java
+++ b/core/src/ch/asynk/tankontank/game/Hex.java
@@ -29,9 +29,10 @@ public class Hex extends Tile
public static final int MOVE = 3;
public static final int DIRECTIONS = 4;
public static final int ORIENTATION = 5;
- public static final int OBJECTIVE = 6; // unclaimed
- public static final int OBJECTIVE_GE= 7;
- public static final int OBJECTIVE_US= 8;
+ public static final int OBJECTIVE = 6;
+ public static final int OBJECTIVE_HOLD = 7;
+ public static final int OBJECTIVE_GE = 8;
+ public static final int OBJECTIVE_US = 9;
public Terrain terrain;
public int roads;
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index b059aab..71f29c7 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -489,11 +489,12 @@ public abstract class Map extends Board
public void showOrientation(Hex hex, Orientation o) { enableOverlayOn(hex, Hex.ORIENTATION, o, true); }
public void hideOrientation(Hex hex) { enableOverlayOn(hex, Hex.ORIENTATION, false); }
- public void hideObjective(Hex hex)
+ public void showObjective(Hex hex, Army army, boolean hold)
{
- enableOverlayOn(hex, Hex.OBJECTIVE, false);
- enableOverlayOn(hex, Hex.OBJECTIVE_US, false);
- enableOverlayOn(hex, Hex.OBJECTIVE_GE, false);
+ if (hold)
+ enableOverlayOn(hex, Hex.OBJECTIVE_HOLD, true);
+ else
+ enableOverlayOn(hex, Hex.OBJECTIVE, true);
}
public void showObjective(Hex hex, Army army)
@@ -502,18 +503,15 @@ public abstract class Map extends Board
case GE:
enableOverlayOn(hex, Hex.OBJECTIVE_GE, true);
enableOverlayOn(hex, Hex.OBJECTIVE_US, false);
- enableOverlayOn(hex, Hex.OBJECTIVE, false);
break;
case US:
enableOverlayOn(hex, Hex.OBJECTIVE_GE, false);
enableOverlayOn(hex, Hex.OBJECTIVE_US, true);
- enableOverlayOn(hex, Hex.OBJECTIVE, false);
break;
case NONE:
default:
enableOverlayOn(hex, Hex.OBJECTIVE_GE, false);
enableOverlayOn(hex, Hex.OBJECTIVE_US, false);
- enableOverlayOn(hex, Hex.OBJECTIVE, true);
break;
}
}
diff --git a/core/src/ch/asynk/tankontank/game/ObjectiveSet.java b/core/src/ch/asynk/tankontank/game/ObjectiveSet.java
index 2a4f3ee..ab827f6 100644
--- a/core/src/ch/asynk/tankontank/game/ObjectiveSet.java
+++ b/core/src/ch/asynk/tankontank/game/ObjectiveSet.java
@@ -21,7 +21,7 @@ public class ObjectiveSet extends HashMap<Hex, Objective> implements MoveToAnima
public void add(Hex hex, Army army, boolean persistent)
{
put(hex, new Objective(army, persistent));
- map.showObjective(hex, army);
+ map.showObjective(hex, army, !persistent);
}
public int count(Army army)