Interface AdvancementService
- All Known Implementing Classes:
StandardAdvancementService
public interface AdvancementService
-
Method Summary
Modifier and TypeMethodDescriptionadvanceProgress
(Profile profile, String missionNameOrId, int amount) AdvancesProgress
by decrementing the value specified by the amount, and returning the prizes rewarded in the form of anAdvancement
object.startMission
(Profile profile, String missionNameOrId)
-
Method Details
-
startMission
Begins aMission
by assigning and creating a new instance ofProgress
. This is shorthand for looking up a mission by name (Mission.getName()
), setting theProfile
and saving to the database.- Parameters:
profile
- theProfile
of the person starting the missionmissionNameOrId
- the unique name of theMission
, as determined byMission.getName()
-
advanceProgress
AdvancesProgress
by decrementing the value specified by the amount, and returning the prizes rewarded in the form of anAdvancement
object. Specifically, this will involve the follwing operations:- If the Profile has no
Progress
for the supplied mission, then there shall be no side-effects. - Otherwise, decrement the value tracked by
Progress.getRemaining()
using the specified amount - If, after subtraction, the result is <= 0 advance to the next
Step
in theMission
- Carry over any remaining actions to the next step.
- Continue rewarding
Reward
instances until all actions are consumed - Continue tracking complete
Step
s until all actions are consumed
- Parameters:
profile
- theProfile
tracking theMission
missionNameOrId
- theMission
's name as determined byMission.getName()
.amount
- the amount of actions to apply to theProgress.getRemaining()
- Returns:
- the
Advancement
, never null
- If the Profile has no
-