public class Quest
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private int |
code
Quest internal code.
|
private boolean |
end
If true, the quest is completed.
|
private int |
face
Quest face.
|
private EventListenerList2<QuestListener> |
listeners
The
QuestListeners to be notified of changes. |
private int |
parent
Quest internal code of this quest's parent, 0 if no parent.
|
private boolean |
replay
If true, the quest can be replayed.
|
private java.lang.String |
step
Description of the current step.
|
private java.lang.String |
title
Quest title.
|
Constructor and Description |
---|
Quest(int code,
java.lang.String title,
int face,
boolean replay,
int parent,
boolean end,
java.lang.String step)
Create a new quest.
|
Modifier and Type | Method and Description |
---|---|
void |
addQuestListener(QuestListener listener)
Adds a
QuestListener to be notified of changes. |
private void |
fireChanged()
Notifies all listeners.
|
int |
getCode()
Get the quest's code.
|
int |
getFace()
Get the quest's face.
|
java.lang.String |
getTitle()
Get the quest's title.
|
java.lang.String |
getTooltipText()
Returns a description for this spell to be used in tooltips.
|
void |
removeQuestListener(QuestListener listener)
Removes a
QuestListener to be notified of changes. |
void |
setStep(boolean end,
java.lang.String step)
Update the quest's state.
|
private final int code
private boolean end
private final int face
@NotNull private final EventListenerList2<QuestListener> listeners
QuestListeners
to be notified of changes.private final int parent
private final boolean replay
@NotNull private java.lang.String step
@NotNull private final java.lang.String title
public Quest(int code, @NotNull java.lang.String title, int face, boolean replay, int parent, boolean end, @NotNull java.lang.String step)
code
- the quest internal code.title
- the quest's title.face
- the quest's face.replay
- if 1 the quest can be replayed.parent
- quest internal code of this quest's parent, 0 if no
parent.end
- if 1 the quest is completed.step
- current quest's step.public void addQuestListener(@NotNull QuestListener listener)
QuestListener
to be notified of changes.listener
- the listener to addprivate void fireChanged()
public int getCode()
public int getFace()
@NotNull public java.lang.String getTitle()
@NotNull public java.lang.String getTooltipText()
public void removeQuestListener(@NotNull QuestListener listener)
QuestListener
to be notified of changes.listener
- the listener to removepublic void setStep(boolean end, @NotNull java.lang.String step)
end
- if true the quest is completed.step
- step description.