Class SustainPlan

java.lang.Object
privbot.mechanics.SustainPlan

public final class SustainPlan extends Object
What to eat and drink, and when. A plan is data: thresholds and item names in preference order. Build one with builder() and hand it to SustainPolicy.

What it proves: nothing by itself. A threshold left at 0 means that rule is off. Item lists are in the order the policy tries them; the first name the inventory holds with the right action wins.

Unreadable looks like: not applicable here; a plan holds no reads.

Thread rule: immutable once built, except the BoostDosePolicy objects handed to SustainPlan.Builder.boost(net.runelite.api.Skill, privbot.mechanics.BoostDosePolicy, java.lang.String...), which keep their own state and belong to one worker thread.

  • Method Details

    • boostSkills

      public Set<net.runelite.api.Skill> boostSkills()
      Returns:
      the skills that have a boost rule, in the order they were added
    • boostPolicy

      public BoostDosePolicy boostPolicy(net.runelite.api.Skill skill)
      Returns:
      the dose policy for skill, or null when the plan has no boost rule for it
    • boostSkillFor

      public net.runelite.api.Skill boostSkillFor(String itemName)
      Parameters:
      itemName - a carried item name
      Returns:
      the skill whose boost rule owns this dose (its policy says it is a dose, or it is one of the listed dose names), or null when no boost rule claims it
    • builder

      public static SustainPlan.Builder builder()
      Returns:
      a new builder with every rule off