Class SustainChoice

java.lang.Object
privbot.mechanics.SustainChoice

public final class SustainChoice extends Object
What SustainPolicy says to do about hitpoints, prayer or a boost this tick. It names an item and the menu action to use on it; it does not act.

What it proves: item() and action() are non-null only for EAT, COMBO_EAT, BREW, RESTORE and BOOST, and the item was seen in the inventory snapshot with that action. NONE means everything read was fine. OUT_OF means a need was read and nothing carried can meet it. UNREADABLE means the inventory, HP or max HP could not be read, which is not the same as NONE.

Thread rule: immutable, safe on any thread.

  • Method Details

    • kind

      public SustainChoice.Kind kind()
      Returns:
      the kind of answer
    • item

      public String item()
      Returns:
      the carried item's name to use, or null when the kind is not an item action
    • action

      public String action()
      Returns:
      "Eat" or "Drink", or null when the kind is not an item action
    • reason

      public String reason()
      Returns:
      a short plain-words reason (never null)
    • toString

      public String toString()
      Overrides:
      toString in class Object