Crossfire JXClient, Trunk  R20561
com.realtime.crossfire.jxclient.quests.QuestsManager Class Reference

Manages all quests for a player. More...

+ Collaboration diagram for com.realtime.crossfire.jxclient.quests.QuestsManager:

Public Member Functions

void addCrossfireQuestChangedListener (@NotNull final QuestsManagerListener listener)
 Adds a QuestsManagerListener to notify about changes. More...
 
void addQuest (final int code, @NotNull final String title, final int face, final boolean replay, final int parent, final boolean end, @NotNull final String description)
 Adds a new quest. More...
 
boolean displaysFace (final int faceNum)
 Returns whether any quest has the given face. More...
 
Quest getQuest (final int index)
 Returns a Quest instance by index. More...
 
int getQuests ()
 Returns the number of current quests. More...
 
 QuestsManager (@NotNull final GuiStateManager guiStateManager)
 Creates a new instance. More...
 
void removeCrossfireQuestChangedListener (@NotNull final QuestsManagerListener listener)
 Removes a QuestsManagerListener to notify about changes. More...
 
void selectCharacter ()
 A character name was sent to the server. More...
 
void updateQuest (final int code, final boolean end, @NotNull final String step)
 Updates quest information. More...
 

Private Attributes

final GuiStateListener guiStateListener
 The GuiStateListener for detecting established or dropped connections. More...
 
final EventListenerList2< QuestsManagerListenerlisteners = new EventListenerList2<>()
 The QuestsManagerListeners to notify about changes. More...
 
final Comparator< QuestquestComparator = new QuestComparator()
 A Comparator to compare Quest instances by title and code. More...
 
final List< Questquests = new CopyOnWriteArrayList<>()
 All quests. More...
 

Detailed Description

Manages all quests for a player.

Author
nicolas

Definition at line 38 of file QuestsManager.java.

Constructor & Destructor Documentation

◆ QuestsManager()

com.realtime.crossfire.jxclient.quests.QuestsManager.QuestsManager ( @NotNull final GuiStateManager  guiStateManager)

Creates a new instance.

Parameters
guiStateManagerthe gui state manager to watch

Definition at line 109 of file QuestsManager.java.

References com.realtime.crossfire.jxclient.quests.QuestsManager.guiStateListener.

Member Function Documentation

◆ addCrossfireQuestChangedListener()

void com.realtime.crossfire.jxclient.quests.QuestsManager.addCrossfireQuestChangedListener ( @NotNull final QuestsManagerListener  listener)

Adds a QuestsManagerListener to notify about changes.

Parameters
listenerthe listener to add

Definition at line 117 of file QuestsManager.java.

References com.realtime.crossfire.jxclient.util.EventListenerList2< T extends EventListener >.add().

+ Here is the call graph for this function:

◆ addQuest()

void com.realtime.crossfire.jxclient.quests.QuestsManager.addQuest ( final int  code,
@NotNull final String  title,
final int  face,
final boolean  replay,
final int  parent,
final boolean  end,
@NotNull final String  description 
)

Adds a new quest.

Parameters
codethe quest's code
titlethe quest's title
facethe quest's face
replaywhether the quest can be replayed or not
parentquest internal code of this quest's parent, 0 if no parent.
endwhether the quest is ended or not
descriptionthe quest's current step

Definition at line 140 of file QuestsManager.java.

References com.realtime.crossfire.jxclient.quests.Quest.setStep().

Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.processAddQuest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaysFace()

boolean com.realtime.crossfire.jxclient.quests.QuestsManager.displaysFace ( final int  faceNum)

Returns whether any quest has the given face.

Parameters
faceNumthe face
Returns
whether the face was found

Definition at line 195 of file QuestsManager.java.

◆ getQuest()

Quest com.realtime.crossfire.jxclient.quests.QuestsManager.getQuest ( final int  index)

Returns a Quest instance by index.

Parameters
indexthe index
Returns
the quest or
null
if the index is invalid

Definition at line 186 of file QuestsManager.java.

Referenced by com.realtime.crossfire.jxclient.items.QuestsView.getItem(), com.realtime.crossfire.jxclient.gui.item.GUIItemQuest.setQuest(), and com.realtime.crossfire.jxclient.gui.list.GUIQuestList.updateTooltip().

+ Here is the caller graph for this function:

◆ getQuests()

int com.realtime.crossfire.jxclient.quests.QuestsManager.getQuests ( )

Returns the number of current quests.

Returns
the number of quests

Definition at line 176 of file QuestsManager.java.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemQuest.canScroll(), and com.realtime.crossfire.jxclient.items.QuestsView.getSize().

+ Here is the caller graph for this function:

◆ removeCrossfireQuestChangedListener()

void com.realtime.crossfire.jxclient.quests.QuestsManager.removeCrossfireQuestChangedListener ( @NotNull final QuestsManagerListener  listener)

Removes a QuestsManagerListener to notify about changes.

Parameters
listenerthe listener to remove

Definition at line 125 of file QuestsManager.java.

References com.realtime.crossfire.jxclient.util.EventListenerList2< T extends EventListener >.remove().

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemQuest.dispose().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ selectCharacter()

void com.realtime.crossfire.jxclient.quests.QuestsManager.selectCharacter ( )

A character name was sent to the server.

Definition at line 208 of file QuestsManager.java.

Referenced by com.realtime.crossfire.jxclient.server.crossfire.AbstractCrossfireServerConnection.fireSelectCharacter().

+ Here is the caller graph for this function:

◆ updateQuest()

void com.realtime.crossfire.jxclient.quests.QuestsManager.updateQuest ( final int  code,
final boolean  end,
@NotNull final String  step 
)

Updates quest information.

Parameters
codethe quest's code
endwhether the quest is ended or not
stepthe quest's current step

Definition at line 163 of file QuestsManager.java.

Referenced by com.realtime.crossfire.jxclient.server.crossfire.DefaultCrossfireServerConnection.processUpdQuest().

+ Here is the caller graph for this function:

Member Data Documentation

◆ guiStateListener

final GuiStateListener com.realtime.crossfire.jxclient.quests.QuestsManager.guiStateListener
private

The GuiStateListener for detecting established or dropped connections.

Definition at line 66 of file QuestsManager.java.

Referenced by com.realtime.crossfire.jxclient.quests.QuestsManager.QuestsManager().

◆ listeners

final EventListenerList2<QuestsManagerListener> com.realtime.crossfire.jxclient.quests.QuestsManager.listeners = new EventListenerList2<>()
private

The QuestsManagerListeners to notify about changes.

Definition at line 51 of file QuestsManager.java.

◆ questComparator

final Comparator<Quest> com.realtime.crossfire.jxclient.quests.QuestsManager.questComparator = new QuestComparator()
private

A Comparator to compare Quest instances by title and code.

Definition at line 58 of file QuestsManager.java.

◆ quests

final List<Quest> com.realtime.crossfire.jxclient.quests.QuestsManager.quests = new CopyOnWriteArrayList<>()
private

All quests.

Definition at line 44 of file QuestsManager.java.


The documentation for this class was generated from the following file: