Class MainQuest
java.lang.Object
com.csse3200.game.missions.Mission
com.csse3200.game.missions.quests.Quest
com.csse3200.game.missions.quests.MainQuest
MainQuests are to represent the 3 main quests of the game as outlined in the storyline wiki.
These
MainQuests have a set of quests the player must complete and a timelimit.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a description of theMainQuest.Gives the current progress of theMainQuest.Gives a short description of theMainQuest's progressbooleanChecks if theMainQuestis complete.voidreadProgress(com.badlogic.gdx.utils.JsonValue progress) Reads the progress specified in theJsonValueinto the questsCompletedvoidregisterMission(EventHandler missionManagerEvents) Registers theMainQuestwith theMissionManagerby adding a listener to the QUEST_REWARD_COLLECTEDMissionManager.MissionEventprotected voidResets the state of theMainQuestby clearing the questsCompleted set.Methods 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
-
Method Details
-
registerMission
Registers theMainQuestwith theMissionManagerby adding a listener to the QUEST_REWARD_COLLECTEDMissionManager.MissionEvent- Specified by:
registerMissionin classMission- Parameters:
missionManagerEvents- A reference to theEventHandleron theMissionManager, with which relevant events should be listened to.
-
isCompleted
public boolean isCompleted()Checks if theMainQuestis complete.- Specified by:
isCompletedin classMission- Returns:
- - true iff player has completed all of the questsToComplete as specific in constructor.
-
getDescription
Gets a description of theMainQuest.- Specified by:
getDescriptionin classMission- Returns:
- - a description containing the goal and
Quests the player has yet to complete.
-
getShortDescription
Gives a short description of theMainQuest's progress- Specified by:
getShortDescriptionin classMission- Returns:
- - description with how many
Quests are yet to be completed
-
readProgress
public void readProgress(com.badlogic.gdx.utils.JsonValue progress) Reads the progress specified in theJsonValueinto the questsCompleted- Specified by:
readProgressin classMission- Parameters:
progress- TheJsonValuerepresenting the progress of theMissionas determined by the value returned ingetProgress().
-
getProgress
Gives the current progress of theMainQuest.- Specified by:
getProgressin classMission- Returns:
- - an
Arraycontaining the names of theQuests that are completed
-
resetState
protected void resetState()Resets the state of theMainQuestby clearing the questsCompleted set.- Specified by:
resetStatein classQuest
-