Class MonsterTreasureTable
java.lang.Object
MonsterTreasureTable
Treasure based on monster type association (Vol-2, p. 22).
Note that this should be used for wilderness encounters only.
(For clarification of that point, see AD&D MM, p. 5.)
- Since:
- 2017-10-15
-
Field Summary
Modifier and TypeFieldDescriptionprivate static MonsterTreasureTable
The singleton class instance.(package private) final String
Name of file with treasure information.private TreasureType[]
Array of TreasureType records. -
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor (read from dedicated file). -
Method Summary
Modifier and TypeMethodDescriptionprivate TreasureType
getByCode
(char code) Get a treasure type by matching its character code.static MonsterTreasureTable
Access the singleton class instance.static void
Main test method.int
randomValueByCode
(char code) Get random treasure value by code.
-
Field Details
-
MONSTER_TREASURE_FILE
Name of file with treasure information.- See Also:
-
instance
The singleton class instance. -
treasureTable
Array of TreasureType records.
-
-
Constructor Details
-
MonsterTreasureTable
Constructor (read from dedicated file).- Throws:
IOException
-
-
Method Details
-
getInstance
Access the singleton class instance. -
getByCode
Get a treasure type by matching its character code. -
randomValueByCode
public int randomValueByCode(char code) Get random treasure value by code. -
main
Main test method.
-