Class AutoQuest


public class AutoQuest extends Quest
AutoQuests are Quests whose Reward is collected automatically, after a certain number of in-game minutes.
  • Constructor Details

    • AutoQuest

      public AutoQuest(String name, Reward reward, String description)
      Creates an AutoQuest, whose Reward will be collected in 1 minute.
      Parameters:
      name - - name of the AutoQuest
      reward - - the Reward to be collected
      description - - description of the AutoQuest
    • AutoQuest

      public AutoQuest(String name, Reward reward, String description, int collectDelay)
      Creates an AutoQuest
      Parameters:
      name - - name of the AutoQuest
      reward - - the Reward to be collected
      description - - description of the AutoQuest
      collectDelay - - the number of minutes before this AutoQuest's Reward is to be collected
  • Method Details

    • registerMission

      public void registerMission(EventHandler missionManagerEvents)
      On registering this mission the Reward is collected.
      Specified by:
      registerMission in class Mission
      Parameters:
      missionManagerEvents - A reference to the EventHandler on the MissionManager, with which relevant events should be listened to.
    • isCompleted

      public boolean isCompleted()
      Always returns true as there is no dynamic progress.
      Specified by:
      isCompleted in class Mission
      Returns:
      - true
    • getDescription

      public String getDescription()
      Returns the description specified in the constructor.
      Specified by:
      getDescription in class Mission
      Returns:
      - description of the AutoQuest
    • getShortDescription

      public String getShortDescription()
      Returns the description as in getDescription() method.
      Specified by:
      getShortDescription in class Mission
      Returns:
      - description of the AutoQuest
    • readProgress

      public void readProgress(com.badlogic.gdx.utils.JsonValue progress)
      Does nothing as AutoQuests have no savable progress
      Specified by:
      readProgress in class Mission
      Parameters:
      progress - The JsonValue representing the progress of the Mission as determined by the value returned in getProgress().
    • getProgress

      public Object getProgress()
      Gets the AutoQuest's progress.
      Specified by:
      getProgress in class Mission
      Returns:
      - always 0 as there is no progress in an AutoQuest
    • resetState

      protected void resetState()
      Does nothing as AutoQuests have no state to reset.
      Specified by:
      resetState in class Quest