diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-28 18:08:37 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-28 18:08:37 +0100 |
commit | a8aec8de788e5d565b6953c8a32def15327a7058 (patch) | |
tree | 11bf2e79982e98f16a402fdd5384a5192641facc /core | |
parent | 34d611a9a342a8f311ed51fab1c9eb8cc84abcaa (diff) | |
download | RustAndDust-a8aec8de788e5d565b6953c8a32def15327a7058.zip RustAndDust-a8aec8de788e5d565b6953c8a32def15327a7058.tar.gz |
Army: add overlay which is hex overlay index
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/Faction.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Army.java | 26 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Factory.java | 2 |
3 files changed, 17 insertions, 12 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/Faction.java b/core/src/ch/asynk/rustanddust/engine/Faction.java index e108fc4..3b93353 100644 --- a/core/src/ch/asynk/rustanddust/engine/Faction.java +++ b/core/src/ch/asynk/rustanddust/engine/Faction.java @@ -3,4 +3,5 @@ package ch.asynk.rustanddust.engine; public interface Faction { public boolean isEnemy(Faction other); + public int overlay(); } diff --git a/core/src/ch/asynk/rustanddust/game/Army.java b/core/src/ch/asynk/rustanddust/game/Army.java index 9a1663b..4bfe10e 100644 --- a/core/src/ch/asynk/rustanddust/game/Army.java +++ b/core/src/ch/asynk/rustanddust/game/Army.java @@ -1,27 +1,31 @@ package ch.asynk.rustanddust.game; import ch.asynk.rustanddust.engine.Faction; +import ch.asynk.rustanddust.game.Hex; import ch.asynk.rustanddust.game.Factory; public enum Army implements Faction { - NONE("None", null), - GE("German", Factory.FLAG_GE), - US("US", Factory.FLAG_US), - USSR("Soviet", null), - EN("English", null); + NONE("None", null, -1), + GE("German", Factory.FLAG_GE, Hex.OBJECTIVE_GE), + US("US", Factory.FLAG_US, Hex.OBJECTIVE_US), + USSR("Soviet", null, -1), + EN("English", null, -1); - private String s; - private String f; + public final String s; + public final String flag; + public final int overlay; - Army(String s, String f) { + Army(String s, String f, int o) { this.s = s; - this.f = f; + this.flag = f; + this.overlay = o; } - public String flag() + @Override + public int overlay() { - return f; + return overlay; } @Override diff --git a/core/src/ch/asynk/rustanddust/game/Factory.java b/core/src/ch/asynk/rustanddust/game/Factory.java index 83968f6..6f5b731 100644 --- a/core/src/ch/asynk/rustanddust/game/Factory.java +++ b/core/src/ch/asynk/rustanddust/game/Factory.java @@ -86,7 +86,7 @@ public class Factory implements Board.TileBuilder, Disposable public AtlasRegion getFlag(Army army) { - return hudAtlas.findRegion(army.flag()); + return hudAtlas.findRegion(army.flag); } public Map getMap(MapType t) |