Package net.sf.gridarta.model.spells
Class Spells<S extends Spell>
- java.lang.Object
-
- net.sf.gridarta.model.spells.Spells<S>
-
- All Implemented Interfaces:
java.lang.Iterable<S>
public class Spells<S extends Spell> extends java.lang.Object implements java.lang.Iterable<S>Common base class for spells and spell lists.
-
-
Constructor Summary
Constructors Constructor Description Spells()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(S spell)Add a spell.SgetSpell(int index)Return one spell object by index.@NotNull java.util.Iterator<S>iterator()Return all known spell objects.intsize()Return the number of existing spell objects.voidsort()Sort the added spells after loading is finished.
-
-
-
Method Detail
-
sort
public void sort()
Sort the added spells after loading is finished.
-
size
public int size()
Return the number of existing spell objects.- Returns:
- the number of existing spell objects
-
iterator
@NotNull public @NotNull java.util.Iterator<S> iterator()
Return all known spell objects.
-
add
public void add(@NotNull S spell)Add a spell.- Parameters:
spell- the spell to add
-
getSpell
public S getSpell(int index)
Return one spell object by index.- Parameters:
index- the spell index- Returns:
- the spell object
-
-