Class QuestsManager
- java.lang.Object
-
- com.realtime.crossfire.jxclient.quests.QuestsManager
-
public class QuestsManager extends java.lang.ObjectManages all quests for a player.
-
-
Constructor Summary
Constructors Constructor Description QuestsManager(@NotNull GuiStateManager guiStateManager)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCrossfireQuestChangedListener(@NotNull QuestsManagerListener listener)Adds aQuestsManagerListenerto notify about changes.voidaddQuest(int code, @NotNull java.lang.String title, int face, boolean replay, int parent, boolean end, @NotNull java.lang.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)java.util.List<Quest>getQuests()Get the list of all quests.voidremoveCrossfireQuestChangedListener(@NotNull QuestsManagerListener listener)Removes aQuestsManagerListenerto notify about changes.voidselectCharacter()A character name was sent to the server.voidupdateQuest(int code, boolean end, @NotNull java.lang.String step)Updates quest information.
-
-
-
Constructor Detail
-
QuestsManager
public QuestsManager(@NotNull @NotNull GuiStateManager guiStateManager)Creates a new instance.- Parameters:
guiStateManager- the gui state manager to watch
-
-
Method Detail
-
addCrossfireQuestChangedListener
public void addCrossfireQuestChangedListener(@NotNull @NotNull QuestsManagerListener listener)Adds aQuestsManagerListenerto notify about changes.- Parameters:
listener- the listener to add
-
removeCrossfireQuestChangedListener
public void removeCrossfireQuestChangedListener(@NotNull @NotNull QuestsManagerListener listener)Removes aQuestsManagerListenerto notify about changes.- Parameters:
listener- the listener to remove
-
addQuest
public void addQuest(int code, @NotNull @NotNull java.lang.String title, int face, boolean replay, int parent, boolean end, @NotNull @NotNull java.lang.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
public void updateQuest(int code, boolean end, @NotNull @NotNull java.lang.String step)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
@Nullable public @Nullable Quest getQuest(int index)
Returns aQuestinstance by index.- Parameters:
index- the index- Returns:
- the quest or
nullif the index is invalid
-
getQuestByCode
@Nullable public final @Nullable Quest getQuestByCode(int code)
-
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
public java.util.List<Quest> getQuests()
Get the list of all quests.- Returns:
- all quests of the player.
-
-