Class QuestTypeRegistry
java.lang.Object
java.util.AbstractMap<String,Class<? extends AbstractQuest>>
java.util.HashMap<String,Class<? extends AbstractQuest>>
com.ordwen.odailyquests.api.quests.QuestTypeRegistry
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
Class<? extends AbstractQuest>>
This class manages the registration and retrieval of quest types.
It extends
HashMap
to store quest types, where the key is the type name and the value is the corresponding quest class.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass
<? extends AbstractQuest> getMainClass
(String type) Retrieves the quest class associated with the specified quest type.void
registerQuestType
(String type, Class<? extends AbstractQuest> questClass) Registers a new quest type by associating a type name with its corresponding quest class.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
QuestTypeRegistry
public QuestTypeRegistry()
-
-
Method Details
-
registerQuestType
Registers a new quest type by associating a type name with its corresponding quest class.- Parameters:
type
- the name of the quest type to registerquestClass
- the class of the quest that corresponds to the type
-
getMainClass
Retrieves the quest class associated with the specified quest type.- Parameters:
type
- the name of the quest type- Returns:
- the
Class
of the quest associated with the type, or null if the type is not registered
-