public Dungeon getDungeonForLocation(Location loc) { String[] keys = getDungeonList(); for (int i = 0; i < keys.length; i++) { String name = keys[i]; Dungeon dungeon = this.dungeons.get(name); if (dungeon == null) { continue; } if (dungeon.containsLocation(loc)) { return dungeon; } } return null; }
public void addDungeon(Dungeon dungeon) { String name = dungeon.getName(); this.dungeons.put(name, dungeon); }