public class MonsterRandomizer extends Object
Modifier and Type | Field and Description |
---|---|
(package private) static MonsterRandomizer |
instance
The singleton class instance.
|
(package private) String |
MONSTER_LEVEL_MATRIX_FILE
Name of file with monster information.
|
(package private) ArrayList<ArrayList<Integer>> |
monsterLevelMatrix
Matrix of what level monster appears.
|
(package private) ArrayList<ArrayList<Monster>> |
monsterLevelTables
Tables of monsters at each level.
|
Modifier | Constructor and Description |
---|---|
protected |
MonsterRandomizer()
Constructor (read from dedicated file).
|
Modifier and Type | Method and Description |
---|---|
static MonsterRandomizer |
getInstance()
Access the singleton class instance.
|
(package private) ArrayList<Integer> |
getMatrixRow(int dungeonLevel)
Find the correct row of the matrix for a given level.
|
static void |
main(String[] args)
Main test method.
|
(package private) void |
makeMonsterLevelTables()
Compile the table of monsters at each level.
|
Monster |
randomMonsterOnDungeonLevel(int dungeonLevel)
Roll a new random monster on a given dungeon level.
|
Monster |
randomMonsterOnTableLevel(int tableLevel)
Roll a new random monster of a given table level.
|
(package private) int |
randomTableLevel(int dungeonLevel)
Roll a random table level for a given dungeon level.
|
(package private) void |
readMonsterLevelMatrix()
Read in the monster level matrix.
|
final String MONSTER_LEVEL_MATRIX_FILE
static MonsterRandomizer instance
ArrayList<ArrayList<Integer>> monsterLevelMatrix
protected MonsterRandomizer() throws IOException
IOException
public static MonsterRandomizer getInstance()
void readMonsterLevelMatrix() throws IOException
IOException
void makeMonsterLevelTables()
public Monster randomMonsterOnDungeonLevel(int dungeonLevel)
int randomTableLevel(int dungeonLevel)
public Monster randomMonsterOnTableLevel(int tableLevel)
ArrayList<Integer> getMatrixRow(int dungeonLevel)
public static void main(String[] args)