diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-21 17:01:33 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-21 17:01:33 +0100 |
commit | bb484b079fca679bf5fbf61439b6e1039cffac16 (patch) | |
tree | db4468740fda0eaf694b14f17bc04910d2f33b16 /core/src/ch | |
parent | 9d95b1ae5a6b5fe456b71616a5a8e8c9ad9025a2 (diff) | |
download | RustAndDust-bb484b079fca679bf5fbf61439b6e1039cffac16.zip RustAndDust-bb484b079fca679bf5fbf61439b6e1039cffac16.tar.gz |
Hex.OBJECTIVE_GE and Hex.OBJECTIVE_US
Diffstat (limited to 'core/src/ch')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hex.java | 4 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 32 |
2 files changed, 32 insertions, 4 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Hex.java b/core/src/ch/asynk/tankontank/game/Hex.java index 63f4422..019e02f 100644 --- a/core/src/ch/asynk/tankontank/game/Hex.java +++ b/core/src/ch/asynk/tankontank/game/Hex.java @@ -29,7 +29,9 @@ 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; + public static final int OBJECTIVE = 6; // unclaimed + public static final int OBJECTIVE_GE= 7; + public static final int OBJECTIVE_US= 8; 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 878a7e3..15f73c8 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -380,9 +380,6 @@ public abstract class Map extends Board public void showPath(Hex dst) { possiblePaths.enable(Hex.MOVE, true); showMove(dst); } public void hidePath(Hex dst) { possiblePaths.enable(Hex.MOVE, false); hideMove(dst); } - public void showObjective(Hex hex) { enableOverlayOn(hex, Hex.OBJECTIVE, true); } - public void hideObjective(Hex hex) { enableOverlayOn(hex, Hex.OBJECTIVE, true); } - public void selectHex(Hex hex) { enableOverlayOn(hex, Hex.SELECT, true); } public void unselectHex(Hex hex) { enableOverlayOn(hex, Hex.SELECT, false); } public void showMove(Hex hex) { enableOverlayOn(hex, Hex.MOVE, true); } @@ -391,4 +388,33 @@ public abstract class Map extends Board public void hideDirections(Hex hex) { enableOverlayOn(hex, Hex.DIRECTIONS, false); } 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) + { + enableOverlayOn(hex, Hex.OBJECTIVE, false); + enableOverlayOn(hex, Hex.OBJECTIVE_US, false); + enableOverlayOn(hex, Hex.OBJECTIVE_GE, false); + } + + public void showObjective(Hex hex, Army army) + { + switch(army) { + 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; + } + } } |