21 package com.realtime.crossfire.jxclient.quests;
24 import org.jetbrains.annotations.NotNull;
86 public Quest(
final int code, @NotNull
final String title,
final int face,
final boolean replay,
final int parent,
final boolean end, @NotNull
final String step) {
126 public void setStep(
final boolean end, @NotNull
final String step) {
127 boolean changed =
false;
129 if (this.end != end) {
134 if (this.step.compareTo(step) != 0) {
150 final StringBuilder sb =
new StringBuilder(
"<b>");
154 sb.append(
" (finished");
156 sb.append(
", can be replayed");
162 return sb.toString();
170 listener.questChanged();
179 listeners.
add(listener);
187 listeners.
remove(listener);
int getCode()
Get the quest's code.
final String title
Quest title.
Describes an in-game quest.
boolean end
If true, the quest is completed.
A list of event listeners.
Interface for listeners interested in Quest related events.
final int code
Quest internal code.
final int face
Quest face.
String step
Description of the current step.
void fireChanged()
Notifies all listeners.
Quest(final int code, @NotNull final String title, final int face, final boolean replay, final int parent, final boolean end, @NotNull final String step)
Create a new quest.
final int parent
Quest internal code of this quest's parent, 0 if no parent.
void add(@NotNull final T listener)
Adds a listener.
final boolean replay
If true, the quest can be replayed.
int getFace()
Get the quest's face.
String getTooltipText()
Returns a description for this spell to be used in tooltips.
String getTitle()
Get the quest's title.
final EventListenerList2< QuestListener > listeners
The QuestListeners to be notified of changes.
void setStep(final boolean end, @NotNull final String step)
Update the quest's state.
void removeQuestListener(@NotNull final QuestListener listener)
Removes a QuestListener to be notified of changes.
void remove(@NotNull final T listener)
Removes a listener.
void addQuestListener(@NotNull final QuestListener listener)
Adds a QuestListener to be notified of changes.