Class Item

java.lang.Object
com.bdtripp.hauntedhouse.model.Item

public class Item extends Object
Represents an item in the game world. Items have names, descriptions, weights, and optional effects on player statistics. Some items may also be edible.
Author:
Brian Tripp
  • Constructor Details

    • Item

      public Item(String name, String description, int weight, boolean isEdible, PlayerStat statToAffect, int affectValue)
      Creates a new item
      Parameters:
      name - the name of the item
      description - a description of the item
      weight - the items weight
      isEdible - whether or not the item is edible
      statToAffect - the stat of a player that the item has an affect on (eg. strength)
      affectValue - the amount to change the stat's value by
  • Method Details

    • getName

      public String getName()
      Returns the name of the item
      Returns:
      the name
    • getDescription

      public String getDescription()
      Returns the description of the item
      Returns:
      the description
    • getWeight

      public int getWeight()
      Returns the weight of the item
      Returns:
      the weight
    • isEdible

      public boolean isEdible()
      Returns whether this item is edible or not
      Returns:
      true if this item is edible
    • getStatToAffect

      public PlayerStat getStatToAffect()
      Returns the stat the item has an effect on
      Returns:
      the stat
    • getAffectValue

      public int getAffectValue()
      Returns the amount to change a stat's value by
      Returns:
      the amount