Class QuestsManager
java.lang.Object
com.realtime.crossfire.jxclient.quests.QuestsManager
Manages all quests for a player.
-
Constructor Summary
ConstructorsConstructorDescriptionQuestsManager
(@NotNull GuiStateManager guiStateManager) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCrossfireQuestChangedListener
(@NotNull QuestsManagerListener listener) Adds aQuestsManagerListener
to notify about changes.void
addQuest
(int code, @NotNull String title, int face, boolean replay, int parent, boolean end, @NotNull String description) Adds a new quest.boolean
displaysFace
(int faceNum) Returns whether any quest has the given face.int
getCount()
Returns the number of current quests.@Nullable Quest
getQuest
(int index) Returns aQuest
instance by index.@Nullable Quest
getQuestByCode
(int code) Get the list of all quests.void
removeCrossfireQuestChangedListener
(@NotNull QuestsManagerListener listener) Removes aQuestsManagerListener
to notify about changes.void
A character name was sent to the server.void
updateQuest
(int code, boolean end, @NotNull String step) Updates quest information.
-
Constructor Details
-
QuestsManager
Creates a new instance.- Parameters:
guiStateManager
- the gui state manager to watch
-
-
Method Details
-
addCrossfireQuestChangedListener
Adds aQuestsManagerListener
to notify about changes.- Parameters:
listener
- the listener to add
-
removeCrossfireQuestChangedListener
Removes aQuestsManagerListener
to notify about changes.- Parameters:
listener
- the listener to remove
-
addQuest
public void addQuest(int code, @NotNull @NotNull String title, int face, boolean replay, int parent, boolean end, @NotNull @NotNull String description) Adds a new quest.- Parameters:
code
- the quest's codetitle
- the quest's titleface
- the quest's facereplay
- whether the quest can be replayed or notparent
- quest internal code of this quest's parent, 0 if no parent.end
- whether the quest is ended or notdescription
- the quest's current step
-
updateQuest
Updates quest information.- Parameters:
code
- the quest's codeend
- whether the quest is ended or notstep
- the quest's current step
-
getCount
public int getCount()Returns the number of current quests.- Returns:
- the number of quests
-
getQuest
Returns aQuest
instance by index.- Parameters:
index
- the index- Returns:
- the quest or
null
if the index is invalid
-
getQuestByCode
-
displaysFace
public boolean displaysFace(int faceNum) Returns whether any quest has the given face.- Parameters:
faceNum
- the face- Returns:
- whether the face was found
-
selectCharacter
public void selectCharacter()A character name was sent to the server. -
getQuests
Get the list of all quests.- Returns:
- all quests of the player.
-