Class DungeonTreasureTable

java.lang.Object
DungeonTreasureTable

public class DungeonTreasureTable extends Object
Treasure based on underworld level beneath surface (Vol-3, p. 7).
Since:
2017-11-18
  • Field Details

  • Constructor Details

    • DungeonTreasureTable

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

    • getInstance

      public static DungeonTreasureTable getInstance()
      Access the singleton class instance.
    • getRecordByLevel

      private DungeonTreasureTable.TreasureRecord getRecordByLevel(int level)
      Get a treasure record by matching its level code.
    • randomValueByRecord

      private int randomValueByRecord(DungeonTreasureTable.TreasureRecord tr)
      Get random value for one treasure record.
    • randomValueByLevel

      public int randomValueByLevel(int level)
      Generate random treasure based on level indicator.
      Parameters:
      level - Level beneath surface of dungeon
    • main

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