Class MissionCompleteQuest
java.lang.Object
com.csse3200.game.missions.Mission
com.csse3200.game.missions.quests.Quest
com.csse3200.game.missions.quests.MissionCompleteQuest
A MissionCompleteQuest class for when a quest which is based around completing a number of missions
-
Constructor Summary
ConstructorsConstructorDescriptionMissionCompleteQuest(String name, Reward reward, int numberOfQuestsToComplete) Creates a new MissionCompleteQuest with the given name, reward and number of quests to completeMissionCompleteQuest(String name, Reward reward, int expiryDuration, boolean isMandatory, int numberOfQuestsToComplete) Creates a new MissionCompleteQuest with the given name, reward, expiry duration, whether the quest is mandatory and number of quests to complete -
Method Summary
Modifier and TypeMethodDescriptionReturns the description of the questReturns the progress of the questReturns the short description of the questbooleanReturns whether the quest is completedvoidreadProgress(com.badlogic.gdx.utils.JsonValue progress) Reads the progress of the questvoidregisterMission(EventHandler missionManagerEvents) Registers the missionprotected voidResets the state of the questMethods inherited from class com.csse3200.game.missions.quests.Quest
collectReward, isExpired, isMandatory, isRewardCollected, read, resetExpiry, updateExpiry, writeMethods inherited from class com.csse3200.game.missions.Mission
getName, notifyUpdate
-
Constructor Details
-
MissionCompleteQuest
Creates a new MissionCompleteQuest with the given name, reward and number of quests to complete- Parameters:
name- The name of the questreward- The reward for completing the questnumberOfQuestsToComplete- The number of quests to complete
-
MissionCompleteQuest
public MissionCompleteQuest(String name, Reward reward, int expiryDuration, boolean isMandatory, int numberOfQuestsToComplete) Creates a new MissionCompleteQuest with the given name, reward, expiry duration, whether the quest is mandatory and number of quests to complete- Parameters:
name- The name of the questreward- The reward for completing the questexpiryDuration- The expiry duration of the questisMandatory- Whether the quest is mandatorynumberOfQuestsToComplete- The number of quests to complete
-
-
Method Details
-
registerMission
Registers the mission- Specified by:
registerMissionin classMission- Parameters:
missionManagerEvents- A reference to theEventHandleron theMissionManager, with which relevant events should be listened to.
-
isCompleted
public boolean isCompleted()Returns whether the quest is completed- Specified by:
isCompletedin classMission- Returns:
- Whether the quest is completed
-
getDescription
Returns the description of the quest- Specified by:
getDescriptionin classMission- Returns:
- The description of the quest
-
getShortDescription
Returns the short description of the quest- Specified by:
getShortDescriptionin classMission- Returns:
- The short description of the quest
-
readProgress
public void readProgress(com.badlogic.gdx.utils.JsonValue progress) Reads the progress of the quest- Specified by:
readProgressin classMission- Parameters:
progress- jsonValue of the progress
-
getProgress
Returns the progress of the quest- Specified by:
getProgressin classMission- Returns:
- The progress of the quest
-
resetState
protected void resetState()Resets the state of the quest- Specified by:
resetStatein classQuest
-