From 5029461112c81ced27efc94797d10968b5f93972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 31 Mar 2016 15:09:15 +0200 Subject: Factory: add getBattle(int) --- core/src/ch/asynk/rustanddust/game/Factory.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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; -- cgit v1.1-2-g2b99