public class QuestsManager
extends java.lang.Object
Constructor and Description |
---|
QuestsManager(@NotNull GuiStateManager guiStateManager)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addCrossfireQuestChangedListener(@NotNull QuestsManagerListener listener)
Adds a
QuestsManagerListener to notify about changes. |
void |
addQuest(int code,
@NotNull java.lang.String title,
int face,
boolean replay,
int parent,
boolean end,
@NotNull java.lang.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 a
Quest instance by index. |
@Nullable Quest |
getQuestByCode(int code) |
java.util.List<Quest> |
getQuests()
Get the list of all quests.
|
void |
removeCrossfireQuestChangedListener(@NotNull QuestsManagerListener listener)
Removes a
QuestsManagerListener to notify about changes. |
void |
selectCharacter()
A character name was sent to the server.
|
void |
updateQuest(int code,
boolean end,
@NotNull java.lang.String step)
Updates quest information.
|
public QuestsManager(@NotNull @NotNull GuiStateManager guiStateManager)
guiStateManager
- the gui state manager to watchpublic void addCrossfireQuestChangedListener(@NotNull @NotNull QuestsManagerListener listener)
QuestsManagerListener
to notify about changes.listener
- the listener to addpublic void removeCrossfireQuestChangedListener(@NotNull @NotNull QuestsManagerListener listener)
QuestsManagerListener
to notify about changes.listener
- the listener to removepublic void addQuest(int code, @NotNull @NotNull java.lang.String title, int face, boolean replay, int parent, boolean end, @NotNull @NotNull java.lang.String description)
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 steppublic void updateQuest(int code, boolean end, @NotNull @NotNull java.lang.String step)
code
- the quest's codeend
- whether the quest is ended or notstep
- the quest's current steppublic int getCount()
@Nullable public @Nullable Quest getQuest(int index)
Quest
instance by index.index
- the indexnull
if the index is invalid@Nullable public @Nullable Quest getQuestByCode(int code)
public boolean displaysFace(int faceNum)
faceNum
- the facepublic void selectCharacter()
public java.util.List<Quest> getQuests()