Class PlantInteractionQuest
java.lang.Object
com.csse3200.game.missions.Mission
com.csse3200.game.missions.quests.Quest
com.csse3200.game.missions.quests.PlantInteractionQuest
A
Quest where the player has to interact with a certain amount of plants.-
Constructor Summary
ConstructorsConstructorDescriptionPlantInteractionQuest(String name, Reward reward, int expiryDuration, MissionManager.MissionEvent interactionType, Set<String> plantTypes, int interactionsTarget) Creates aPlantInteractionQuestwith an expiryPlantInteractionQuest(String name, Reward reward, MissionManager.MissionEvent interactionType, Set<String> plantTypes, int interactionsTarget) Creates aPlantInteractionQuest -
Method Summary
Modifier and TypeMethodDescriptionDescription of thePlantInteractionQuestGets thePlantInteractionQuestShort description of thePlantInteractionQuestbooleanChecks ifPlantInteractionQuestis completevoidreadProgress(com.badlogic.gdx.utils.JsonValue progress) Reads in the currentPlantInteractionQuestfrom aJsonValuevoidregisterMission(EventHandler missionManagerEvents) Registers thePlantInteractionQuestwith theMissionManagerby adding listeners to the interaction type.protected voidResets the number of plant interactions to 0Methods 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
-
PlantInteractionQuest
public PlantInteractionQuest(String name, Reward reward, MissionManager.MissionEvent interactionType, Set<String> plantTypes, int interactionsTarget) Creates aPlantInteractionQuest- Parameters:
name- Quest namereward- Reward the player can collect once completeinteractionType- Type of plant interactionplantTypes- Plant types the player can interact withinteractionsTarget- Number of interactions the player needs to complete the quest
-
PlantInteractionQuest
public PlantInteractionQuest(String name, Reward reward, int expiryDuration, MissionManager.MissionEvent interactionType, Set<String> plantTypes, int interactionsTarget) Creates aPlantInteractionQuestwith an expiry- Parameters:
name- Quest namereward- Reward the player can collect once completeexpiryDuration- How long until the Quest will expireinteractionType- Type of plant interactionplantTypes- Plant types the player can interact withinteractionsTarget- Number of interactions the player needs to complete
-
-
Method Details
-
registerMission
Registers thePlantInteractionQuestwith theMissionManagerby adding listeners to the interaction type.- Specified by:
registerMissionin classMission- Parameters:
missionManagerEvents- A reference to theEventHandleron theMissionManager, with which relevant events should be listened to.
-
isCompleted
public boolean isCompleted()Checks ifPlantInteractionQuestis complete- Specified by:
isCompletedin classMission- Returns:
- True iff player has completed at least the amount of target interactions
-
getDescription
Description of thePlantInteractionQuest- Specified by:
getDescriptionin classMission- Returns:
- - Long description of the
PlantInteractionQuestwith player progress
-
getShortDescription
Short description of thePlantInteractionQuest- Specified by:
getShortDescriptionin classMission- Returns:
- - short description of the players plant interaction progress
-
readProgress
public void readProgress(com.badlogic.gdx.utils.JsonValue progress) Reads in the currentPlantInteractionQuestfrom aJsonValue- Specified by:
readProgressin classMission- Parameters:
progress- TheJsonValuerepresenting the progress of theMissionas determined by the value returned ingetProgress().
-
getProgress
Gets thePlantInteractionQuest- Specified by:
getProgressin classMission- Returns:
- Number of plant interactions the player has made
-
resetState
protected void resetState()Resets the number of plant interactions to 0- Specified by:
resetStatein classQuest
-