Class ConsumePlayerItemsReward

java.lang.Object
com.csse3200.game.missions.rewards.Reward
com.csse3200.game.missions.rewards.ConsumePlayerItemsReward

public class ConsumePlayerItemsReward extends Reward
A ConsumePlayerItemsReward class for when the player completes a Quest which should result in a certain number of inventory items to be removed from the inventory.
  • Constructor Details

    • ConsumePlayerItemsReward

      public ConsumePlayerItemsReward(Map<String,Integer> toRemove)
      Creates a ConsumePlayerItemsReward reward, which, when collected, removes a specified number of items from the player's inventory.
      Parameters:
      toRemove - A Map mapping item names to item quantities, representing the names of items to remove, and the quantity of that item to remove.
  • Method Details

    • collect

      public void collect()
      When called, changes the isCollected variable to true and removes the specified items to the player's inventory.
      Specified by:
      collect in class Reward