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 RSEnumDefinitiongetEnum(int id)static ItemDefinitiongetFuzzyItem(String name, Predicate<ItemDefinition> predicate)static ItemDefinitiongetItem(int id)static ItemDefinitiongetItem(String name, Predicate<ItemDefinition> predicate)Gets anItemDefinitionby name matching the given predicatestatic Map<Integer,ItemDefinition>getItems()static ItemDefinitiongetMaxConsumableFuzzyItem(String name)4 dose infixes:" potion", " brew", "super ", " balm", "serum" "venom" "poison", " balance", "antifire", " remedy", "antidote", " reststatic NpcDefinitiongetNpc(int id)static Map<Integer,NpcDefinition>getNpcs()static ObjectDefinitiongetObject(int id)static Map<Integer,ObjectDefinition>getObjects()static <K extends RSTransformableDefinition,T extends TransformableDefinition<K,T>>
TgetTransformable(int id, Class<T> type)static RSVarpbitgetVarpbit(int id)static booleanisInitialMembers()static voidpopulate()Loads and caches game definitions.static voidsetInitialMembers(boolean initialMembers)
-
-
-
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 anItemDefinitionby name matching the given predicate- Parameters:
name- The name of the item, ornullto not match by namepredicate- Predicate to select the item- Returns:
- The first
ItemDefinitionwith 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", " rest2 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()
-
isInitialMembers
public static boolean isInitialMembers()
-
setInitialMembers
public static void setInitialMembers(boolean initialMembers)
-
-