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 TypeMethodDescriptionvoidaddCrossfireQuestChangedListener(@NotNull QuestsManagerListener listener) Adds aQuestsManagerListenerto notify about changes.voidaddQuest(int code, @NotNull String title, int face, boolean replay, int parent, boolean end, @NotNull String description) Adds a new quest.booleandisplaysFace(int faceNum) Returns whether any quest has the given face.intgetCount()Returns the number of current quests.@Nullable QuestgetQuest(int index) Returns aQuestinstance by index.@Nullable QuestgetQuestByCode(int code) Get the list of all quests.voidremoveCrossfireQuestChangedListener(@NotNull QuestsManagerListener listener) Removes aQuestsManagerListenerto notify about changes.voidA character name was sent to the server.voidupdateQuest(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 aQuestsManagerListenerto notify about changes.- Parameters:
listener- the listener to add
-
removeCrossfireQuestChangedListener
Removes aQuestsManagerListenerto 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 aQuestinstance by index.- Parameters:
index- the index- Returns:
- the quest or
nullif 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.
-