|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.classes.magic.SpellRegistry
Class that manages the XML spell registry, which contains metadata about all the spells. The metadata includes: which class implements the spell, the lore level, the Art and Elements, the spellbook description, and so on - pretty much everything that would go into a Spell Manual.
Method Summary | |
static Spell |
cloneSpell(java.lang.String name)
Clones a spell from its name. |
static Spell |
cloneSpellByClass(java.lang.String name)
Clones and initializes a spell from its classname. |
static boolean |
contains(java.lang.String name)
Returns true if the registry contains the passed spell. |
static Art |
getArt(java.lang.String name)
Returns the Art for the specified spell. |
static java.lang.String |
getClassName(java.lang.String name)
Returns the name of the class implementing this spell. |
static java.lang.String |
getDescription(java.lang.String name)
Returns the spell description - a sentence fragment that describes the spell, such as "allows the caster to see in the dark." |
static Element |
getElement(java.lang.String name)
Returns the Element for the specified spell. |
static java.lang.String |
getFullDescription(java.lang.String name)
Returns the full spell description - a sentence of the form "This (Art) of (Elements) (description)." |
static int |
getLore(java.lang.String name)
Returns the spell lore level |
static java.util.List |
getReagents(java.lang.String name)
Returns the spell reagents. |
static java.util.List |
getRegisteredSpells()
Returns a sorted list of all spells in the registry. |
static java.util.List |
getSpellsByArtAndElement(Art art,
Element element)
Returns a list of all of spells of the passed Art and/or Element(s). |
static java.util.List |
getSpellsByLevel(int level)
Returns a list of all the spells of the passed Lore level. |
static java.lang.String |
getTitle(java.lang.String name)
Returns the "title" of a spell, such as "Conjuration of Water and Air". |
static boolean |
isLearnable(java.lang.String name)
Returns true if this spell can be learned by Players. |
static java.lang.String |
listReagents(java.lang.String name)
Returns a user-visible list of the spell reagents. |
static void |
main(java.lang.String[] args)
Testing. |
static boolean |
okNoSpells(java.lang.String name)
Returns true if this spell can be cast in no-spells areas. |
static void |
reload()
Reloads the spell registry from disk - called by admins when the spell repository has been changed from outside the game engine. |
static java.util.List |
xpath(java.lang.String query)
Takes an arbitrary XPath expression and returns a List whose elements are the names of the spells matching the expression, or an empty list. |
static int |
xpathCount(java.lang.String query)
Takes an arbitrary XPath expression that has an integer result, and evaluates and returns it on the spell registry. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void reload()
public static boolean contains(java.lang.String name)
name
- the name of the spell, e.g. "create earth wall"
public static java.util.List getRegisteredSpells()
public static java.lang.String getClassName(java.lang.String name)
name
- the spell name, e.g. "word of recall"
java.lang.IllegalArgumentException
- if the passed spell
isn't in the registry.public static java.lang.String getDescription(java.lang.String name)
name
- the spell name, e.g. "word of recall"
java.lang.IllegalArgumentException
- if the passed spell
isn't in the registry.public static java.lang.String getFullDescription(java.lang.String name)
name
- the spell name, e.g. "word of recall"
java.lang.IllegalArgumentException
- if the passed spell
isn't in the registry.public static java.lang.String getTitle(java.lang.String name)
name
- the spell name, e.g. "word of recall"
java.lang.IllegalArgumentException
- if the passed spell
isn't in the registry.public static int getLore(java.lang.String name)
name
- the spell name, e.g. "word of recall"
java.lang.IllegalArgumentException
- if the passed spell
isn't in the registry.public static Art getArt(java.lang.String name)
name
- the spell name, e.g. "word of recall"
java.lang.IllegalArgumentException
- if the passed spell
isn't in the registry.public static Element getElement(java.lang.String name)
name
- the spell name, e.g. "word of recall"
java.lang.IllegalArgumentException
- if the passed spell
isn't in the registry.public static boolean okNoSpells(java.lang.String name)
name
- the spell name, e.g. "word of recall"
java.lang.IllegalArgumentException
- if the passed spell
isn't in the registry.public static boolean isLearnable(java.lang.String name)
name
- the spell name, e.g. "word of recall"
java.lang.IllegalArgumentException
- if the passed spell
isn't in the registry.public static java.util.List getReagents(java.lang.String name)
public static java.lang.String listReagents(java.lang.String name)
name
- the spell name
public static java.util.List getSpellsByLevel(int level)
level
- a lore level
public static java.util.List getSpellsByArtAndElement(Art art, Element element)
art
- the spell Art (can be null, but Element must be non-null)element
- the spell Element (can be null, but Art must be non-null)
java.lang.IllegalArgumentException
- if Art and Element are both nullpublic static java.util.List xpath(java.lang.String query) throws java.lang.Exception
query
- an XPath - you need to know the data model (and XPath)
in order to use this. I don't recommend it.
java.lang.Exception
public static int xpathCount(java.lang.String query) throws java.lang.Exception
query
- an XPath - you need to know the data model (and XPath)
in order to use this. I don't recommend it.
java.lang.Exception
public static Spell cloneSpell(java.lang.String name)
name
- the spell name, e.g. "confuse monster"
public static Spell cloneSpellByClass(java.lang.String name)
name
- either a python relative path, e.g.
"lib/spells/confuse_monster.py", or "wiz/rhialto/python/foospell.py",
or a fully-qualified java classname, e.g. "wiz.foobar.spells.MySpell".
java.lang.IllegalArgumentException
- if it couldn't be loadedpublic static void main(java.lang.String[] args) throws java.lang.Throwable
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |