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 questboolean
Returns whether the quest is completedvoid
readProgress
(com.badlogic.gdx.utils.JsonValue progress) Reads the progress of the questvoid
registerMission
(EventHandler missionManagerEvents) Registers the missionprotected void
Resets the state of the questMethods inherited from class com.csse3200.game.missions.quests.Quest
collectReward, isExpired, isMandatory, isRewardCollected, read, resetExpiry, updateExpiry, write
Methods 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:
registerMission
in classMission
- Parameters:
missionManagerEvents
- A reference to theEventHandler
on theMissionManager
, with which relevant events should be listened to.
-
isCompleted
public boolean isCompleted()Returns whether the quest is completed- Specified by:
isCompleted
in classMission
- Returns:
- Whether the quest is completed
-
getDescription
Returns the description of the quest- Specified by:
getDescription
in classMission
- Returns:
- The description of the quest
-
getShortDescription
Returns the short description of the quest- Specified by:
getShortDescription
in 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:
readProgress
in classMission
- Parameters:
progress
- jsonValue of the progress
-
getProgress
Returns the progress of the quest- Specified by:
getProgress
in classMission
- Returns:
- The progress of the quest
-
resetState
protected void resetState()Resets the state of the quest- Specified by:
resetState
in classQuest
-