diff --git a/res/quest/world/worlds.txt b/res/quest/world/worlds.txt index 5dd455ce6a8..ac3de71b800 100644 --- a/res/quest/world/worlds.txt +++ b/res/quest/world/worlds.txt @@ -1 +1 @@ -Index:1|Name:Shandalar|Dir:shandalar|Sets:2ED, ARN, ATQ, 3ED, LEG, DRK, FEM, 4ED, ICE, CHR, HML, ALL|Banned:Chaos Orb; Falling Star \ No newline at end of file +Index:1|Name:Shandalar|Dir:shandalar|Sets:2ED, ARN, ATQ, 3ED, LEG, DRK, 4ED|Banned:Chaos Orb; Falling Star \ No newline at end of file diff --git a/src/main/java/forge/model/FModel.java b/src/main/java/forge/model/FModel.java index b3266913db2..97b2f75ffee 100644 --- a/src/main/java/forge/model/FModel.java +++ b/src/main/java/forge/model/FModel.java @@ -364,6 +364,15 @@ public enum FModel { return this.formats; } + /** + * Gets the game worlds. + * + * @return the worlds + */ + public final IStorageView getWorlds() { + return this.worlds; + } + /** * Finalizer, generally should be avoided, but here closes the log file * stream and resets the system output streams. diff --git a/src/main/java/forge/quest/data/QuestData.java b/src/main/java/forge/quest/data/QuestData.java index af546e68fda..9a2dd20545f 100644 --- a/src/main/java/forge/quest/data/QuestData.java +++ b/src/main/java/forge/quest/data/QuestData.java @@ -17,6 +17,7 @@ */ package forge.quest.data; +import forge.Singletons; import forge.game.GameFormat; import forge.quest.QuestMode; import forge.quest.io.QuestDataIO; @@ -51,7 +52,8 @@ public final class QuestData { /** The mode. */ private QuestMode mode; - + // Quest world ID, if any + private String worldId; // gadgets private final QuestAssets assets; @@ -81,6 +83,7 @@ public final class QuestData { this.mode = mode2; this.achievements = new QuestAchievements(diff); this.assets = new QuestAssets(format); + this.worldId = null; // Default to "no world", i.e. regular opponents and challenges } @@ -102,6 +105,17 @@ public final class QuestData { return this.format; } + /** + * Gets the QuestWorld, if any. + * + * @return QuestWorld or null, if using regular duels and challenges. + */ + public QuestWorld getWorld() { + if (this.worldId == null) { + return null; + } + return Singletons.getModel().getWorlds().get(worldId); + } // SERIALIZATION - related things // This must be called by XML-serializer via reflection