diff options
Diffstat (limited to 'core/src')
-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; + } + } } |