Interface AdvancementService
- All Known Implementing Classes:
StandardAdvancementService
public interface AdvancementService
-
Method Summary
Modifier and TypeMethodDescriptionadvanceProgress(Profile profile, String missionNameOrId, int amount) AdvancesProgressby decrementing the value specified by the amount, and returning the prizes rewarded in the form of anAdvancementobject.startMission(Profile profile, String missionNameOrId)
-
Method Details
-
startMission
Begins aMissionby assigning and creating a new instance ofProgress. This is shorthand for looking up a mission by name (Mission.getName()), setting theProfileand saving to the database.- Parameters:
profile- theProfileof the person starting the missionmissionNameOrId- the unique name of theMission, as determined byMission.getName()
-
advanceProgress
AdvancesProgressby decrementing the value specified by the amount, and returning the prizes rewarded in the form of anAdvancementobject. Specifically, this will involve the follwing operations:- If the Profile has no
Progressfor 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
Stepin theMission - Carry over any remaining actions to the next step.
- Continue rewarding
Rewardinstances until all actions are consumed - Continue tracking complete
Steps until all actions are consumed
- Parameters:
profile- theProfiletracking theMissionmissionNameOrId- 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
-