diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-02-09 14:28:11 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-02-09 14:28:11 +0100 |
commit | 17ec9220007929f598b862b3e44eb3128ddf9003 (patch) | |
tree | 15e37eb9583cd723d3046ae8666c4728c997391a /core/src/ch/asynk/tankontank/game/battles | |
parent | 15257cfb2750a439a55e993fd85b2c2ccd5478b8 (diff) | |
download | RustAndDust-17ec9220007929f598b862b3e44eb3128ddf9003.zip RustAndDust-17ec9220007929f598b862b3e44eb3128ddf9003.tar.gz |
Config: add attribute int i to Graphics enum then replace switch code with String.format()
Diffstat (limited to 'core/src/ch/asynk/tankontank/game/battles')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/battles/Factory.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/core/src/ch/asynk/tankontank/game/battles/Factory.java b/core/src/ch/asynk/tankontank/game/battles/Factory.java index 57328ad..7002e43 100644 --- a/core/src/ch/asynk/tankontank/game/battles/Factory.java +++ b/core/src/ch/asynk/tankontank/game/battles/Factory.java @@ -60,18 +60,11 @@ public class Factory implements Board.TileBuilder, Disposable public void assetsLoaded() { if (assetsLoaded) return; + int i = game.config.graphics.i; this.hudAtlas = game.manager.get("data/hud.atlas", TextureAtlas.class); this.tileOverlaysAtlas = game.manager.get("data/hex-overlays.atlas", TextureAtlas.class); - switch (game.config.graphics) { - case MINE: - this.pawnsAtlas = game.manager.get("data/units0.atlas", TextureAtlas.class); - this.pawnOverlaysAtlas = game.manager.get("data/unit-overlays0.atlas", TextureAtlas.class); - break; - case ORIGINAL: - this.pawnsAtlas = game.manager.get("data/units1.atlas", TextureAtlas.class); - this.pawnOverlaysAtlas = game.manager.get("data/unit-overlays1.atlas", TextureAtlas.class); - break; - } + this.pawnsAtlas = game.manager.get(String.format("data/units%d.atlas", i), TextureAtlas.class); + this.pawnOverlaysAtlas = game.manager.get(String.format("data/unit-overlays%d.atlas", i), TextureAtlas.class); this.assetsLoaded = true; } |