Class Quest
java.lang.Object
com.csse3200.game.missions.Mission
com.csse3200.game.missions.quests.Quest
- Direct Known Subclasses:
AutoQuest,ClearDebrisQuest,FertiliseCropTilesQuest,FishingQuest,InventoryStateQuest,MainQuest,ManageHostilesQuest,MissionCompleteQuest,OxygenLevelQuest,PlantInteractionQuest,ShipRepairQuest,TameAnimalsQuest
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotected -
Method Summary
Modifier and TypeMethodDescriptionvoidCollects the reward associated with thisQuest.booleanReturns a boolean value representing whether the quest has expired.booleanDetermines whether the quest is mandatory or notbooleanReturns a boolean value representing if this quest's rewards has been collected yet.voidread(com.badlogic.gdx.utils.JsonValue jsonValue) voidResets theQuest's time to expiry back to the original expiry duration, and calls theQuest'sresetState()method.protected abstract voidResets the internal state of theQuest, to what it was before being accepted/modified.voidDecrements the duration to expiry of the quest by 1, if theQuestcan expire.voidwrite(com.badlogic.gdx.utils.Json json) Methods inherited from class com.csse3200.game.missions.Mission
getDescription, getName, getProgress, getShortDescription, isCompleted, notifyUpdate, readProgress, registerMission
-
Constructor Details
-
Quest
-
Quest
Creates aQuestwith the givenStringname, specifying theRewardfor completion, the integer duration of theQuest(the number of hours before theQuestexpires), and whether theQuestis mandatory.Quests created using this constructor will expire after the specified time limit.- Parameters:
name- TheStringname of theQuest, visible to the player in-gamereward- TheRewardwhich can be collected upon completion of theQuestexpiryDuration- An integer value representing the number of hours before thisQuestshould expireisMandatory- A boolean value representing whether theQuestis mandatory. MandatoryQuests will result in a game over if it is not completed before it expires.
-
-
Method Details
-
updateExpiry
public void updateExpiry()Decrements the duration to expiry of the quest by 1, if theQuestcan expire. -
isExpired
public boolean isExpired()Returns a boolean value representing whether the quest has expired. If theQuestdoes not expire, then this method will always return false.- Returns:
- True if the
Questcan expire and has expired, false otherwise.
-
isMandatory
public boolean isMandatory()Determines whether the quest is mandatory or not- Returns:
- boolean value representing whether the quest is mandatory
-
isRewardCollected
public boolean isRewardCollected()Returns a boolean value representing if this quest's rewards has been collected yet.- Returns:
- True if the reward has been collected, false otherwise.
-
collectReward
public void collectReward() -
resetExpiry
public void resetExpiry()Resets theQuest's time to expiry back to the original expiry duration, and calls theQuest'sresetState()method. This method only callsresetState()if it cannot expire. -
resetState
protected abstract void resetState()Resets the internal state of theQuest, to what it was before being accepted/modified. -
write
public void write(com.badlogic.gdx.utils.Json json) -
read
public void read(com.badlogic.gdx.utils.JsonValue jsonValue)
-