Class InventoryStateQuest
java.lang.Object
com.csse3200.game.missions.Mission
com.csse3200.game.missions.quests.Quest
com.csse3200.game.missions.quests.InventoryStateQuest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanReturns a boolean value representing whether theMissionhas been completed.voidreadProgress(com.badlogic.gdx.utils.JsonValue progress) Sets the internal progress of theMissionbased on theJsonValueprovided.voidregisterMission(EventHandler missionManagerEvents) Registers theMissionto theMissionManager, by adding all event listeners to the service which theMissionneeds to listen to in order to update its state.protected voidResets the internal state of theQuest, to what it was before being accepted/modified.Methods 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
-
InventoryStateQuest
-
InventoryStateQuest
-
-
Method Details
-
checkPlayerInventoryMissing
protected boolean checkPlayerInventoryMissing() -
registerMission
Description copied from class:MissionRegisters theMissionto theMissionManager, by adding all event listeners to the service which theMissionneeds to listen to in order to update its state.- Specified by:
registerMissionin classMission- Parameters:
missionManagerEvents- A reference to theEventHandleron theMissionManager, with which relevant events should be listened to.
-
isCompleted
public boolean isCompleted()Description copied from class:MissionReturns a boolean value representing whether theMissionhas been completed.- Specified by:
isCompletedin classMission- Returns:
- A boolean value representing whether the
Missionhas been completed.
-
getDescription
Description copied from class:MissionReturns aStringdescription of theMission. This can involve an explanation of what the player needs to do to complete theMission, and may dynamically change depending on the progress the player has made. For instance, you might choose to include in your description: "You have currently harvested X out of N plants".- Specified by:
getDescriptionin classMission- Returns:
- A
Stringdescription of theMission, including any relevant details you would like the player to know about.
-
getShortDescription
Description copied from class:MissionReturns a shortStringdescription of theMission. This description should be at most around 50 characters. This might simply contain progress information on theMission, or a shortened form ofMission.getDescription().- Specified by:
getShortDescriptionin classMission- Returns:
- A short
Stringdescription of theMission
-
readProgress
public void readProgress(com.badlogic.gdx.utils.JsonValue progress) Description copied from class:MissionSets the internal progress of theMissionbased on theJsonValueprovided. TheJsonValueprovided should match the sameJsonValue.ValueTypereturned byMission.getProgress(). AnExceptionmight be raised otherwise (depending on the methods you use to get the state of theJsonValue).- Specified by:
readProgressin classMission- Parameters:
progress- TheJsonValuerepresenting the progress of theMissionas determined by the value returned inMission.getProgress().
-
getProgress
Description copied from class:MissionGets the progress of theMissionas anObject, which contains all relevant information about the internal progress of theMission. All stats which dynamically change should be stored in thisObjectin some way (i.e., all non-final values). Since this value will need to be read later usingMission.readProgress(JsonValue)as aJsonValue, you should make sure the returnedObject's serialisation is known to you. This is easy for primitive types, lists, and maps, so try to make the data that you actively track of primitive type (or a list/map of primitive types). Note that forQuests, you do not need to store the time to expiry or whether the reward has been collected - you only need to store the changing state specific to theQuest.- Specified by:
getProgressin classMission- Returns:
- An
Object, which stores the internal progress of theMission. ThisObjectshould be serialisable, and the data should be able to be read as aJsonValueinMission.readProgress(JsonValue).
-
resetState
protected void resetState()Description copied from class:QuestResets the internal state of theQuest, to what it was before being accepted/modified.- Specified by:
resetStatein classQuest
-