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 aTameAnimalsQuest
TameAnimalsQuest
(String name, Reward reward, int expiryDuration, int numberOfAnimalsToTame) Creates aTameAnimalsQuest
with an expiry -
Method Summary
Modifier and TypeMethodDescriptionGets a description of theTameAnimalsQuest
Gets theTameAnimalsQuest
's progressGets a short descritiopn of theTameAnimalsQuest
boolean
Checks if theTameAnimalsQuest
is completevoid
readProgress
(com.badlogic.gdx.utils.JsonValue progress) Reads in the currentTameAnimalsQuest
from aJsonValue
void
registerMission
(EventHandler missionManagerEvents) Register theTameAnimalsQuest
with theMissionManager
by adding listener to the ANIMAL_TAMEDMissionManager.MissionEvent
protected void
Resets number of animals tamed back to 0Methods 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
-
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 aTameAnimalsQuest
with an expiry- Parameters:
name
- Name of the questreward
- Reward the player can collect on completionexpiryDuration
- How long until theTameAnimalsQuest
numberOfAnimalsToTame
- Number of animals the player must claim
-
-
Method Details
-
registerMission
Register theTameAnimalsQuest
with theMissionManager
by adding listener to the ANIMAL_TAMEDMissionManager.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 theTameAnimalsQuest
is complete- Specified by:
isCompleted
in classMission
- Returns:
- Returns true iff the player has tamed at least the target amount of animals
-
getDescription
Gets a description of theTameAnimalsQuest
- Specified by:
getDescription
in classMission
- Returns:
- The quest's description
-
getShortDescription
Gets a short descritiopn of theTameAnimalsQuest
- Specified by:
getShortDescription
in classMission
- Returns:
- The
TameAnimalsQuest
's short description with its progress
-
readProgress
public void readProgress(com.badlogic.gdx.utils.JsonValue progress) Reads in the currentTameAnimalsQuest
from aJsonValue
- Specified by:
readProgress
in classMission
- Parameters:
progress
- TheJsonValue
representing the progress of theMission
as determined by the value returned ingetProgress()
.
-
getProgress
Gets theTameAnimalsQuest
's progress- Specified by:
getProgress
in 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:
resetState
in classQuest
-