summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-03-31 15:09:15 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-03-31 15:09:15 +0200
commit5029461112c81ced27efc94797d10968b5f93972 (patch)
tree66d9bd45f90255a5749e4b36df43303cb8db4f54 /core/src/ch/asynk
parent38410ab3a01253e53637b345adec0559c331c6e7 (diff)
downloadRustAndDust-5029461112c81ced27efc94797d10968b5f93972.zip
RustAndDust-5029461112c81ced27efc94797d10968b5f93972.tar.gz
Factory: add getBattle(int)
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Factory.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Factory.java b/core/src/ch/asynk/rustanddust/game/Factory.java
index 5817ab9..f48094e 100644
--- a/core/src/ch/asynk/rustanddust/game/Factory.java
+++ b/core/src/ch/asynk/rustanddust/game/Factory.java
@@ -61,6 +61,15 @@ public class Factory implements Board.TileBuilder, Disposable
game.db.storeBattle(battles[i].getId(), battles[i].getName());
}
+ public Battle getBattle(int id)
+ {
+ for (int i = 0; i < battles.length; i++) {
+ if (battles[i].getId() == id)
+ return battles[i];
+ }
+ return null;
+ }
+
public void assetsLoaded()
{
if (assetsLoaded) return;