|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.lib.classes.magic.Element
Typesafe enum that represents the eight spell Elements, as well as multi-Element combinations like "Fire and Water".
There are eight single Elements, and multi-Elements can be created with any combination of up to 8 different single Elements. There are:
Note that each Element has an opposite: FIRE and WATER are opposing elements, as are EARTH and AIR, LIFE and DEATH, and MIND and SPIRIT.
In practice, it's very rare to have spells that need more than two elements.
Method Summary | |
java.lang.String |
getCapName()
Returns the capitalized name for this Element, e.g. |
static Element |
getElement(java.lang.String[] names)
Returns the single or combo element specified by a list of Element names. |
java.lang.String |
getName()
Returns the Element name, lowercased. |
java.util.List |
getNames()
Returns the List of names for this element. |
java.util.List |
getSkillNames()
Returns the list of skill names for this Element. |
boolean |
includes(Element single)
Returns true if the passed Element includes the specified single Elements. |
boolean |
isMulti()
Returns true if this is a "multi" (i.e. combo) element, such as "Fire and Water", or "Air, Earth and Mind". |
static boolean |
isValidName(java.lang.String name)
Returns true if the passed element name is one of the eight valid single-element names. |
static void |
main(java.lang.String[] args)
Tests out creating and using multi-element combinations. |
java.lang.String |
toString()
Returns the Element name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Element FIRE
public static final Element WATER
public static final Element EARTH
public static final Element AIR
public static final Element LIFE
public static final Element DEATH
public static final Element MIND
public static final Element SPIRIT
public static final Element[] ELEMENTS
public static final Element FIRE_AND_WATER
public static final Element FIRE_AND_EARTH
public static final Element FIRE_AND_AIR
public static final Element FIRE_AND_LIFE
public static final Element FIRE_AND_DEATH
public static final Element FIRE_AND_MIND
public static final Element FIRE_AND_SPIRIT
public static final Element WATER_AND_EARTH
public static final Element WATER_AND_AIR
public static final Element WATER_AND_LIFE
public static final Element WATER_AND_DEATH
public static final Element WATER_AND_MIND
public static final Element WATER_AND_SPIRIT
public static final Element EARTH_AND_AIR
public static final Element EARTH_AND_LIFE
public static final Element EARTH_AND_DEATH
public static final Element EARTH_AND_MIND
public static final Element EARTH_AND_SPIRIT
public static final Element AIR_AND_LIFE
public static final Element AIR_AND_DEATH
public static final Element AIR_AND_MIND
public static final Element AIR_AND_SPIRIT
public static final Element LIFE_AND_DEATH
public static final Element LIFE_AND_MIND
public static final Element LIFE_AND_SPIRIT
public static final Element DEATH_AND_MIND
public static final Element DEATH_AND_SPIRIT
public static final Element MIND_AND_SPIRIT
Method Detail |
public java.lang.String toString()
public java.lang.String getName()
public java.util.List getNames()
public java.util.List getSkillNames()
public java.lang.String getCapName()
public boolean includes(Element single)
single
- a single element like FIRE, or MIND
public static boolean isValidName(java.lang.String name)
name
- a lowercased, single element name like "fire"
public boolean isMulti()
public static Element getElement(java.lang.String[] names)
names
- an array of element names. None of the names
can be repeated, but they can be in any order. The array
can have up to 8 names in it, and they must all be valid
element names from this list: "fire", "water", "earth", "air",
"life", "death", "mind", "spirit".
java.lang.IllegalArgumentException
- if any of the element
names are invalid, or the array null or is of length zero,
or if any of the names are repeated.public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |