java.lang.Object
java.lang.Enum<Reduction>
net.storm.api.movement.pathfinder.model.requirement.Reduction
All Implemented Interfaces:
Serializable, Comparable<Reduction>, Constable

public enum Reduction extends Enum<Reduction>
Enumeration of logical reduction modes for combining multiple item checks.

Reduction defines how multiple item IDs in an ItemRequirement should be combined when checking for satisfaction.

Reduction Modes

  • AND - All items must be present (conjunction)
  • OR - At least one item must be present (disjunction)
  • NONE - No items should be present (negation)

Usage Examples


 // Require ALL of these items
 new ItemRequirement(Reduction.AND, List.of(
     ItemID.HAMMER, ItemID.CHISEL, ItemID.KNIFE
 ), 1);

 // Require ANY of these light sources
 new ItemRequirement(Reduction.OR, List.of(
     ItemID.BULLSEYE_LANTERN_LIT,
     ItemID.KANDARIN_HEADGEAR_4,
     ItemID.FIREMAKING_CAPE
 ), Location.EITHER, 1);

 // Require player does NOT have these items (blacklist)
 new ItemRequirement(Reduction.NONE, List.of(
     ItemID.KARAMJA_RUM
 ), 1);
 
See Also:
  • Enum Constant Details

    • AND

      public static final Reduction AND
      All items in the list must meet the count requirement.
    • OR

      public static final Reduction OR
      At least one item in the list must meet the count requirement.
    • NONE

      public static final Reduction NONE
      None of the items in the list should meet the count requirement.
  • Method Details

    • values

      public static Reduction[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Reduction valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null