Enum Spellbook
- java.lang.Object
-
- java.lang.Enum<Spellbook>
-
- com.kraken.api.service.magic.spellbook.Spellbook
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SpellbookgetCurrentSpellbook()Retrieves the current spellbook being used in the game.CastableSpell[]getSpells()Retrieves the array of spells associated with the current spellbook.static booleanisOnAncientSpellbook()static booleanisOnArceuusSpellbook()static booleanisOnLunarSpellbook()static booleanisOnStandardSpellbook()static SpellbookvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Spellbook[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static Spellbook[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Spellbook c : Spellbook.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Spellbook valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getSpells
public CastableSpell[] getSpells()
Retrieves the array of spells associated with the current spellbook.Depending on the type of spellbook (e.g.,
LUNAR,STANDARD,ANCIENT, orARCEUUS), this method initializes and returns an array of spells belonging to that specific spellbook. If the spellbook cannot be determined, an empty array is returned.If this method is called before the spells are initialized, it will populate the corresponding spell array based on the spellbook type and cache the result for subsequent calls.
- Returns:
- An array of
CastableSpellobjects representing the spells available in the current spellbook. If the spellbook is not recognized, an empty array ofCastableSpellwill be returned.
-
isOnStandardSpellbook
public static boolean isOnStandardSpellbook()
-
isOnAncientSpellbook
public static boolean isOnAncientSpellbook()
-
isOnLunarSpellbook
public static boolean isOnLunarSpellbook()
-
isOnArceuusSpellbook
public static boolean isOnArceuusSpellbook()
-
getCurrentSpellbook
public static Spellbook getCurrentSpellbook()
Retrieves the current spellbook being used in the game.The method determines the active spellbook by checking the corresponding game variable (varbit) value and matching it with the
valueof the enum constants defined inSpellbook.If no match is found, the
STANDARDspellbook is returned by default.- Returns:
- The active
Spellbookinstance, which represents the currently selected spellbook in the game. Defaults toSTANDARDif no match is found.
-
-