public class SpellUniverse
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
SpellUniverse(GenericSpell[] spells) |
SpellUniverse(java.util.List spells)
Constructor that takes a sparse table of spells for each level and
assigns that internally.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
accessFlattenedSpellNames()
Flattens out the map into a sorted array of spell names
|
GenericSpell[] |
accessFlattenedSpells()
Flattens out the map into a sorted array.
|
GenericSpell |
accessSpell(java.lang.String spellName) |
boolean |
addSpell(java.lang.String spellName) |
void |
addToStorage(java.util.List<GenericSpell> spells)
Adds a list of spells to the library for future consumption.
|
boolean |
hasSpell(java.lang.String spellName) |
GenericSpell[] |
spawn(java.lang.String[] spellNames) |
GenericSpell[] |
spawn(java.lang.String[] spellNames,
byte spellsPerLevel) |
GenericSpell[] |
spawn(java.lang.String[] spellNames,
byte spellsPerLevel,
int startLevel) |
SpellUniverse |
spawnComplement(java.lang.String[] spellNames)
Spawns a universe of spells that is a subset of all the spells in this
universe minus the spells listed in the given spell names.
|
SpellUniverse |
spawnForLevels(int start,
int stop)
Spawns a universe of spells between start and stop levels
|
SpellUniverse |
spawnIntersection(java.lang.String[] spellNames)
Spawns a universe of spells that is a subset of this universe by the
given spell names.
|
java.util.Map |
spawnLevelList()
Spawns a map of lists of spell names keyed by (Byte) spell level.
|
void |
wait(int time) |
public SpellUniverse(java.util.List spells)
spells
- the row is the spell level; each row has a sorted array of its spellspublic SpellUniverse(GenericSpell[] spells)
public GenericSpell[] accessFlattenedSpells()
public java.lang.String[] accessFlattenedSpellNames()
public GenericSpell accessSpell(java.lang.String spellName) throws SpellNotFoundException
SpellNotFoundException
public boolean addSpell(java.lang.String spellName)
public boolean hasSpell(java.lang.String spellName)
public SpellUniverse spawnIntersection(java.lang.String[] spellNames)
spellNames
- public SpellUniverse spawnComplement(java.lang.String[] spellNames)
spellNames
- public GenericSpell[] spawn(java.lang.String[] spellNames)
public GenericSpell[] spawn(java.lang.String[] spellNames, byte spellsPerLevel)
public GenericSpell[] spawn(java.lang.String[] spellNames, byte spellsPerLevel, int startLevel)
public SpellUniverse spawnForLevels(int start, int stop)
start
- stop
- public java.util.Map spawnLevelList()
public void addToStorage(java.util.List<GenericSpell> spells)
public void wait(int time)