Class TameAnimalsQuest
java.lang.Object
com.csse3200.game.missions.Mission
com.csse3200.game.missions.quests.Quest
com.csse3200.game.missions.quests.TameAnimalsQuest
A
Quest where the player must tame animals-
Constructor Summary
ConstructorsConstructorDescriptionTameAnimalsQuest(String name, Reward reward, int numberOfAnimalsToTame) Creates aTameAnimalsQuestTameAnimalsQuest(String name, Reward reward, int expiryDuration, int numberOfAnimalsToTame) Creates aTameAnimalsQuestwith an expiry -
Method Summary
Modifier and TypeMethodDescriptionGets a description of theTameAnimalsQuestGets theTameAnimalsQuest's progressGets a short descritiopn of theTameAnimalsQuestbooleanChecks if theTameAnimalsQuestis completevoidreadProgress(com.badlogic.gdx.utils.JsonValue progress) Reads in the currentTameAnimalsQuestfrom aJsonValuevoidregisterMission(EventHandler missionManagerEvents) Register theTameAnimalsQuestwith theMissionManagerby adding listener to the ANIMAL_TAMEDMissionManager.MissionEventprotected voidResets number of animals tamed back 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
-
TameAnimalsQuest
Creates aTameAnimalsQuest- Parameters:
name- Name of the questreward- Reward the player can collect on completionnumberOfAnimalsToTame- Number of animals the player must claim
-
TameAnimalsQuest
Creates aTameAnimalsQuestwith an expiry- Parameters:
name- Name of the questreward- Reward the player can collect on completionexpiryDuration- How long until theTameAnimalsQuestnumberOfAnimalsToTame- Number of animals the player must claim
-
-
Method Details
-
registerMission
Register theTameAnimalsQuestwith theMissionManagerby adding listener to the ANIMAL_TAMEDMissionManager.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 theTameAnimalsQuestis complete- Specified by:
isCompletedin classMission- Returns:
- Returns true iff the player has tamed at least the target amount of animals
-
getDescription
Gets a description of theTameAnimalsQuest- Specified by:
getDescriptionin classMission- Returns:
- The quest's description
-
getShortDescription
Gets a short descritiopn of theTameAnimalsQuest- Specified by:
getShortDescriptionin classMission- Returns:
- The
TameAnimalsQuest's short description with its progress
-
readProgress
public void readProgress(com.badlogic.gdx.utils.JsonValue progress) Reads in the currentTameAnimalsQuestfrom aJsonValue- Specified by:
readProgressin classMission- Parameters:
progress- TheJsonValuerepresenting the progress of theMissionas determined by the value returned ingetProgress().
-
getProgress
Gets theTameAnimalsQuest's progress- Specified by:
getProgressin classMission- Returns:
- The number of animals the player has currently tamed
-
resetState
protected void resetState()Resets number of animals tamed back to 0- Specified by:
resetStatein classQuest
-