diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-03-31 15:09:15 +0200 | 
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-03-31 15:09:15 +0200 | 
| commit | 5029461112c81ced27efc94797d10968b5f93972 (patch) | |
| tree | 66d9bd45f90255a5749e4b36df43303cb8db4f54 /core/src/ch | |
| parent | 38410ab3a01253e53637b345adec0559c331c6e7 (diff) | |
| download | RustAndDust-5029461112c81ced27efc94797d10968b5f93972.zip RustAndDust-5029461112c81ced27efc94797d10968b5f93972.tar.gz  | |
Factory: add getBattle(int)
Diffstat (limited to 'core/src/ch')
| -rw-r--r-- | core/src/ch/asynk/rustanddust/game/Factory.java | 9 | 
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;  | 
