Class GenericRequirement
java.lang.Object
net.storm.api.movement.pathfinder.model.requirement.GenericRequirement
- All Implemented Interfaces:
Supplier<Boolean>,Requirement
A flexible requirement that compares a supplied value against an expected value.
GenericRequirement allows creating custom requirements by providing a value supplier function, an expected value, and a comparison operator.
Flexibility
Unlike specific requirement types, GenericRequirement can check any integer value from any source:
- Custom calculations
- Combined values
- Dynamic thresholds
- Non-standard game state
Usage Example
// Check if player has at least 1000 coins total (bank + inventory)
GenericRequirement goldReq = new GenericRequirement(
() -> Static.getBank().getCount(ItemID.COINS)
+ Static.getInventory().getCount(ItemID.COINS),
1000,
Comparison.GREATER_THAN_EQUAL
);
// Check if combat level is at least 100
GenericRequirement combatReq = new GenericRequirement(
() -> Static.getPlayers().getLocal().getCombatLevel(),
100,
Comparison.GREATER_THAN_EQUAL
);
if (goldReq.get()) {
// Player has enough gold
}
- See Also:
-
Field Summary
Fields inherited from interface net.storm.api.movement.pathfinder.model.requirement.Requirement
ARCEUUS_FAIRY_RING, CABIN_FEVER_QUEST, DESERT_DIARY_ELITE, GRAND_TREE_QUEST, ICTHLARINS_LITTLE_HELPER, KARAMJA_DIARY_HARD, KHAREDST_PAGE_1, KHAREDST_PAGE_2, KHAREDST_PAGE_3, KHAREDST_PAGE_4, KHAREDST_PAGE_5, KUDOS_153, MONKEY_MADNESS_I, MONKEY_MADNESS_I_FINISHED, MONKEY_MADNESS_II, ONE_SMALL_FAVOUR, PANDEMONIUM_COMPLETED, PRIEST_IN_PERIL_QUEST, REGICIDE_QUEST, SONG_OF_THE_ELVES_QUEST, SUMMER_SHORE_COMPLETED, THE_GOLEM, VISITED_DEEPFIN_POINT, VISITED_KOUREND, VISITED_MORYTANIA, VISITED_PORT_ROBERTS, VISITED_VARLAMORE -
Constructor Summary
Constructors -
Method Summary