Class MonsterTables
java.lang.Object
MonsterTables
Tables of monsters organized by level.
For use in generating & data-tracking random encounters.
- Since:
- 2014-07-18
-
Field Summary
Modifier and TypeFieldDescription(package private) static MonsterTables
The singleton class instance.(package private) final String
Name of file with monster information.Matrix of what level monster appears.Tables of monsters at each level. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
Compile the table of monsters at each level.int
Get grand total monster kills.static MonsterTables
Access the singleton class instance.getMatrixRow
(int dungeonLevel) Convert dungeon level to row in matrix.int
Get the number of tables (i.e., max monster level).getTable
(int level) Access one of the monster tables (1-based).int
getTotalKillsAtLevel
(int tableLevel) Get total kills for a given monster table.iterator()
Return iterator for the iterable interface.static void
Main test method.randomMonsterByDungeonLevel
(int dungeonLevel) Roll a new random monster on a given dungeon level.private Monster
randomMonsterByTableLevel
(int tableLevel) Roll a new random monster of a given table level.private int
randomMonsterLevel
(int dungeonLevel) Roll a random monster level for a given dungeon level.private void
Read in the monster level matrix.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
MONSTER_LEVEL_MATRIX_FILE
Name of file with monster information.- See Also:
-
instance
The singleton class instance. -
monsterLevelMatrix
Matrix of what level monster appears. -
monsterTables
Tables of monsters at each level.
-
-
Constructor Details
-
MonsterTables
Constructor (read from dedicated file).- Throws:
IOException
-
-
Method Details
-
getInstance
Access the singleton class instance. -
iterator
Return iterator for the iterable interface. -
readMonsterLevelMatrix
Read in the monster level matrix.- Throws:
IOException
-
compileMonsterTables
private void compileMonsterTables()Compile the table of monsters at each level. -
getNumTables
public int getNumTables()Get the number of tables (i.e., max monster level). -
getTable
Access one of the monster tables (1-based). -
randomMonsterByDungeonLevel
Roll a new random monster on a given dungeon level. -
randomMonsterByTableLevel
Roll a new random monster of a given table level. -
randomMonsterLevel
private int randomMonsterLevel(int dungeonLevel) Roll a random monster level for a given dungeon level. -
getMatrixRow
Convert dungeon level to row in matrix. -
getTotalKillsAtLevel
public int getTotalKillsAtLevel(int tableLevel) Get total kills for a given monster table. -
getGrandTotalKills
public int getGrandTotalKills()Get grand total monster kills. -
main
Main test method.
-