Package org.rspeer.game
Class Definitions
- java.lang.Object
-
- org.rspeer.game.Definitions
-
public class Definitions extends Object
-
-
Constructor Summary
Constructors Constructor Description Definitions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RSEnumDefinition
getEnum(int id)
static ItemDefinition
getFuzzyItem(String name, Predicate<ItemDefinition> predicate)
static ItemDefinition
getItem(int id)
static ItemDefinition
getItem(String name, Predicate<ItemDefinition> predicate)
Gets anItemDefinition
by name matching the given predicatestatic Map<Integer,ItemDefinition>
getItems()
static ItemDefinition
getMaxConsumableFuzzyItem(String name)
4 dose infixes:" potion", " brew", "super ", " balm", "serum" "venom" "poison", " balance", "antifire", " remedy", "antidote", " rest
static NpcDefinition
getNpc(int id)
static Map<Integer,NpcDefinition>
getNpcs()
static ObjectDefinition
getObject(int id)
static Map<Integer,ObjectDefinition>
getObjects()
static <K extends RSTransformableDefinition,T extends TransformableDefinition<K,T>>
TgetTransformable(int id, Class<T> type)
static RSVarpbit
getVarpbit(int id)
static void
populate()
Loads and caches game definitions.
-
-
-
Method Detail
-
populate
public static void populate()
Loads and caches game definitions. Please note that this function is intended for internal use only
-
getTransformable
public static <K extends RSTransformableDefinition,T extends TransformableDefinition<K,T>> T getTransformable(int id, Class<T> type)
-
getEnum
public static RSEnumDefinition getEnum(int id)
-
getVarpbit
public static RSVarpbit getVarpbit(int id)
-
getNpc
public static NpcDefinition getNpc(int id)
-
getObject
public static ObjectDefinition getObject(int id)
-
getItem
public static ItemDefinition getItem(int id)
-
getItem
public static ItemDefinition getItem(String name, Predicate<ItemDefinition> predicate)
Gets anItemDefinition
by name matching the given predicate- Parameters:
name
- The name of the item, ornull
to not match by namepredicate
- Predicate to select the item- Returns:
- The first
ItemDefinition
with the given name matching the predicate
-
getFuzzyItem
public static ItemDefinition getFuzzyItem(String name, Predicate<ItemDefinition> predicate)
-
getMaxConsumableFuzzyItem
public static ItemDefinition getMaxConsumableFuzzyItem(String name)
4 dose infixes:
" potion", " brew", "super ", " balm", "serum" "venom" "poison", " balance", "antifire", " remedy", "antidote", " rest
2 dose infixes:
" mix", "supermix"
8 dose infixes:
"ring of duel", "games necklace", "watering can"
6 dose infixes:
"amulet of glory", "skills necklace", "combat bracelet"
5 dose infixes:
"ring of wealth", "necklace of passage", "burning amulet", "ring of returning
- Parameters:
name
- The item key, doses/charges stripped- Returns:
- The ItemDefinition of the max consumable item if found, otherwise returns the highest ID match
-
getObjects
public static Map<Integer,ObjectDefinition> getObjects()
-
getItems
public static Map<Integer,ItemDefinition> getItems()
-
getNpcs
public static Map<Integer,NpcDefinition> getNpcs()
-
-