public class MonsterList extends Object
Modifier and Type | Field and Description |
---|---|
(package private) static MonsterList |
instance
The singleton class instance.
|
(package private) String |
MONSTER_FILE
Name of file with monster information.
|
(package private) ArrayList<Monster> |
monsterList
Array of Monster records.
|
Modifier | Constructor and Description |
---|---|
protected |
MonsterList()
Constructor (read from dedicated file).
|
Modifier and Type | Method and Description |
---|---|
Monster |
get(int index) |
Monster |
getByType(String type)
Get a monster by matching its type.
|
static MonsterList |
getInstance()
Access the singleton class instance.
|
static void |
main(String[] args)
Main test method.
|
int |
size() |
final String MONSTER_FILE
static MonsterList instance
protected MonsterList() throws IOException
IOException
public int size()
public Monster get(int index)
public static MonsterList getInstance()
public static void main(String[] args)