java.lang.Object
com.csse3200.game.inventory.items.lootbox.configs.LootItemConfig

public class LootItemConfig extends Object
LootItemConfig is a configuration class representing a specific loot item, including its class type, weight, constructor parameters, and how to instantiate it. This class is used in loot tables to define items that can be generated from loot boxes with a specified probability.
  • Constructor Details

    • LootItemConfig

      public LootItemConfig(Class<? extends AbstractItem> item, double weight, Class<?>[] parameterTypes, Object[] parameters)
      Constructs a LootItemConfig with the specified item class, weight, and constructor parameters.
      Parameters:
      item - The class type of the loot item (must extend AbstractItem).
      weight - The weight of the item, determining its probability of being selected.
      parameterTypes - An array of Classes representing the types of parameters for the item's constructor.
      parameters - An array of Objects representing the parameters to pass to the constructor when creating an item.
  • Method Details