Class MonsterTreasureTable

java.lang.Object
MonsterTreasureTable

public class MonsterTreasureTable extends Object
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 Details

    • MONSTER_TREASURE_FILE

      final String MONSTER_TREASURE_FILE
      Name of file with treasure information.
      See Also:
    • instance

      private static MonsterTreasureTable instance
      The singleton class instance.
    • treasureTable

      private TreasureType[] treasureTable
      Array of TreasureType records.
  • Constructor Details

    • MonsterTreasureTable

      protected MonsterTreasureTable() throws IOException
      Constructor (read from dedicated file).
      Throws:
      IOException
  • Method Details

    • getInstance

      public static MonsterTreasureTable getInstance()
      Access the singleton class instance.
    • getByCode

      private TreasureType getByCode(char code)
      Get a treasure type by matching its character code.
    • randomValueByCode

      public int randomValueByCode(char code)
      Get random treasure value by code.
    • main

      public static void main(String[] args)
      Main test method.