diff --git a/.gitattributes b/.gitattributes index afb31e08107..02f32f6a7fe 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13150,6 +13150,7 @@ src/main/java/forge/quest/data/QuestAssets.java -text src/main/java/forge/quest/data/QuestData.java svneol=native#text/plain src/main/java/forge/quest/data/QuestItemCondition.java -text src/main/java/forge/quest/data/QuestPreferences.java svneol=native#text/plain +src/main/java/forge/quest/data/QuestWorld.java -text src/main/java/forge/quest/data/package-info.java svneol=native#text/plain src/main/java/forge/quest/io/PreconReader.java -text src/main/java/forge/quest/io/QuestDataIO.java svneol=native#text/plain diff --git a/res/quest/quest.properties b/res/quest/quest.properties index 10e19eea351..69e16353ae9 100644 --- a/res/quest/quest.properties +++ b/res/quest/quest.properties @@ -11,6 +11,7 @@ prefs--file=quest.preferences duels-dir--file=duels challenges-dir--file=challenges +world-dir--file=world data-dir--file=data precons-dir--file=precons diff --git a/src/main/java/forge/properties/NewConstants.java b/src/main/java/forge/properties/NewConstants.java index bbf1482a019..d1142e2d8e5 100644 --- a/src/main/java/forge/properties/NewConstants.java +++ b/src/main/java/forge/properties/NewConstants.java @@ -202,6 +202,8 @@ public final class NewConstants { public static final String DUELS = "quest/duels-dir"; /** */ public static final String CHALLENGES = "quest/challenges-dir"; + /** */ + public static final String WORLD = "quest/world-dir"; /** The XMLDATA. */ public static final String XMLDATA = "quest/data-xml"; diff --git a/src/main/java/forge/quest/data/QuestWorld.java b/src/main/java/forge/quest/data/QuestWorld.java new file mode 100644 index 00000000000..b9de09df991 --- /dev/null +++ b/src/main/java/forge/quest/data/QuestWorld.java @@ -0,0 +1,83 @@ +/* + * Forge: Play Magic: the Gathering. + * Copyright (C) 2011 Nate + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package forge.quest.data; + +/** + * This function holds the "world info" for the current quest. + * + */ +public class QuestWorld { + private final int index; // Used internally to identify the quest world + private final String name; + private final String dir; + private final GameFormatQuest format; + + /** + * Instantiate a new quest world. + * @param useIdx int, the quest world internal identifier + * @param useName String, the display name for the world + * @param useDir String, the basedir that contains the duels and challenges for the quest world + * @param useFormat GameFormatQuest that contains the initial format for the world + */ + public QuestWorld(final int useIdx, final String useName, final String useDir, final GameFormatQuest useFormat) { + index = useIdx; + name = useName; + dir = useDir; + format = useFormat; + } + + /** + * The quest world internal identifier. + * @return int, the index + */ + public int getIndex() { + return index; + } + + /** + * The quest world display name. + * @return String, the display name + */ + public String getName() { + return name; + } + + /** + * The quest world duels directory. + * @return String, the duels directory + */ + public String getDuelsDir() { + return dir + "/duels"; + } + + /** + * The quest world challenges directory. + * @return String, the challenges directory + */ + public String getChallengesDir() { + return dir + "/challenges"; + } + + /** + * The quest world format if specified. + * @return GameFormatQuest, the format + */ + public GameFormatQuest getFormat() { + return format; + } +}