Class Quest


  • public class Quest
    extends java.lang.Object
    Describes an in-game quest.
    • Constructor Summary

      Constructors 
      Constructor Description
      Quest​(int code, @NotNull java.lang.String title, int face, boolean replay, int parent, boolean end, @NotNull java.lang.String step)
      Create a new quest.
    • Constructor Detail

      • Quest

        public Quest​(int code,
                     @NotNull
                     @NotNull java.lang.String title,
                     int face,
                     boolean replay,
                     int parent,
                     boolean end,
                     @NotNull
                     @NotNull java.lang.String step)
        Create a new quest.
        Parameters:
        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.
    • Method Detail

      • getCode

        public int getCode()
        Get the quest's code.
        Returns:
        code.
      • getTitle

        @NotNull
        public @NotNull java.lang.String getTitle()
        Get the quest's title.
        Returns:
        title.
      • getFace

        public int getFace()
        Get the quest's face.
        Returns:
        face index.
      • isCompleted

        public boolean isCompleted()
      • replayable

        public boolean replayable()
      • setStep

        public void setStep​(boolean end,
                            @NotNull
                            @NotNull java.lang.String step)
        Update the quest's state.
        Parameters:
        end - if true the quest is completed.
        step - step description.
      • getTooltipText

        @NotNull
        public @NotNull java.lang.String getTooltipText()
        Returns a description for this spell to be used in tooltips.
        Returns:
        the tooltip text
      • addQuestListener

        public void addQuestListener​(@NotNull
                                     @NotNull QuestListener listener)
        Adds a QuestListener to be notified of changes.
        Parameters:
        listener - the listener to add
      • removeQuestListener

        public void removeQuestListener​(@NotNull
                                        @NotNull QuestListener listener)
        Removes a QuestListener to be notified of changes.
        Parameters:
        listener - the listener to remove