Class ShipRepairQuest
java.lang.Object
com.csse3200.game.missions.Mission
com.csse3200.game.missions.quests.Quest
com.csse3200.game.missions.quests.ShipRepairQuest
A
Quest
where player must repair ship to a certain level.-
Constructor Summary
ConstructorsConstructorDescriptionShipRepairQuest
(String name, Reward reward, int targetShipRepairProgress) Creates aShipRepairQuest
ShipRepairQuest
(String name, Reward reward, int expiryDuration, int targetShipRepairProgress) Creates aShipRepairQuest
with expiry -
Method Summary
Modifier and TypeMethodDescriptionGets a description of theShipRepairQuest
The progress of theShipRepairQuest
Gets a short description of theShipRepairQuest
boolean
Checks ifShipRepairQuest
is completevoid
readProgress
(com.badlogic.gdx.utils.JsonValue progress) Reads in the currentShipRepairQuest
from aJsonValue
void
registerMission
(EventHandler missionManagerEvents) RegistersShipRepairQuest
withMissionManager
by listening to SHIP_PART_ADDED eventprotected void
Resets the current ship repair progress back to 0.Methods 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
-
ShipRepairQuest
Creates aShipRepairQuest
- Parameters:
name
- Name of the Questreward
- Reward the player can collect on completiontargetShipRepairProgress
- How much the player must repair ship by
-
ShipRepairQuest
public ShipRepairQuest(String name, Reward reward, int expiryDuration, int targetShipRepairProgress) Creates aShipRepairQuest
with expiry- Parameters:
name
- Name of the Questreward
- Reward the player can collect on completionexpiryDuration
- How long until theShipRepairQuest
is expiredtargetShipRepairProgress
- How much the player must repair ship by
-
-
Method Details
-
registerMission
RegistersShipRepairQuest
withMissionManager
by listening to SHIP_PART_ADDED event- 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 ifShipRepairQuest
is complete- Specified by:
isCompleted
in classMission
- Returns:
- True iff the player has repaired the ship by at least the target amount
-
getDescription
Gets a description of theShipRepairQuest
- Specified by:
getDescription
in classMission
- Returns:
ShipRepairQuest
description
-
getShortDescription
Gets a short description of theShipRepairQuest
- Specified by:
getShortDescription
in classMission
- Returns:
- Short quest description showing the players progress
-
readProgress
public void readProgress(com.badlogic.gdx.utils.JsonValue progress) Reads in the currentShipRepairQuest
from aJsonValue
- Specified by:
readProgress
in classMission
- Parameters:
progress
- TheJsonValue
representing the progress of theMission
as determined by the value returned ingetProgress()
.
-
getProgress
The progress of theShipRepairQuest
- Specified by:
getProgress
in classMission
- Returns:
- current ship repair progress
-
resetState
protected void resetState()Resets the current ship repair progress back to 0.- Specified by:
resetState
in classQuest
-