Class QuestsManager

java.lang.Object
com.realtime.crossfire.jxclient.quests.QuestsManager

public class QuestsManager extends Object
Manages all quests for a player.
  • Constructor Details

    • QuestsManager

      public QuestsManager(@NotNull @NotNull GuiStateManager guiStateManager)
      Creates a new instance.
      Parameters:
      guiStateManager - the gui state manager to watch
  • Method Details

    • addCrossfireQuestChangedListener

      public void addCrossfireQuestChangedListener(@NotNull @NotNull QuestsManagerListener listener)
      Adds a QuestsManagerListener to notify about changes.
      Parameters:
      listener - the listener to add
    • removeCrossfireQuestChangedListener

      public void removeCrossfireQuestChangedListener(@NotNull @NotNull QuestsManagerListener listener)
      Removes a QuestsManagerListener to notify about changes.
      Parameters:
      listener - the listener to remove
    • addQuest

      public void addQuest(int code, @NotNull @NotNull String title, int face, boolean replay, int parent, boolean end, @NotNull @NotNull String description)
      Adds a new quest.
      Parameters:
      code - the quest's code
      title - the quest's title
      face - the quest's face
      replay - whether the quest can be replayed or not
      parent - quest internal code of this quest's parent, 0 if no parent.
      end - whether the quest is ended or not
      description - the quest's current step
    • updateQuest

      public void updateQuest(int code, boolean end, @NotNull @NotNull String step)
      Updates quest information.
      Parameters:
      code - the quest's code
      end - whether the quest is ended or not
      step - 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 a Quest instance by index.
      Parameters:
      index - the index
      Returns:
      the quest or null if the index is invalid
    • getQuestByCode

      @Nullable public @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 List<Quest> getQuests()
      Get the list of all quests.
      Returns:
      all quests of the player.