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
MainQuest
s 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 progressboolean
Checks if theMainQuest
is complete.void
readProgress
(com.badlogic.gdx.utils.JsonValue progress) Reads the progress specified in theJsonValue
into the questsCompletedvoid
registerMission
(EventHandler missionManagerEvents) Registers theMainQuest
with theMissionManager
by adding a listener to the QUEST_REWARD_COLLECTEDMissionManager.MissionEvent
protected void
Resets the state of theMainQuest
by clearing the questsCompleted set.Methods 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
-
Method Details
-
registerMission
Registers theMainQuest
with theMissionManager
by adding a listener to the QUEST_REWARD_COLLECTEDMissionManager.MissionEvent
- 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()Checks if theMainQuest
is complete.- Specified by:
isCompleted
in classMission
- Returns:
- - true iff player has completed all of the questsToComplete as specific in constructor.
-
getDescription
Gets a description of theMainQuest
.- Specified by:
getDescription
in classMission
- Returns:
- - a description containing the goal and
Quest
s the player has yet to complete.
-
getShortDescription
Gives a short description of theMainQuest
's progress- Specified by:
getShortDescription
in classMission
- Returns:
- - description with how many
Quest
s are yet to be completed
-
readProgress
public void readProgress(com.badlogic.gdx.utils.JsonValue progress) Reads the progress specified in theJsonValue
into the questsCompleted- Specified by:
readProgress
in classMission
- Parameters:
progress
- TheJsonValue
representing the progress of theMission
as determined by the value returned ingetProgress()
.
-
getProgress
Gives the current progress of theMainQuest
.- Specified by:
getProgress
in classMission
- Returns:
- - an
Array
containing the names of theQuest
s that are completed
-
resetState
protected void resetState()Resets the state of theMainQuest
by clearing the questsCompleted set.- Specified by:
resetState
in classQuest
-