Class UsableItem

java.lang.Object
com.adventure.models.items.Item
com.adventure.models.items.UsableItem
All Implemented Interfaces:
Usable

public class UsableItem extends Item implements Usable
Usable item. Gives some boost or nerf.
  • Constructor Details

    • UsableItem

      public UsableItem(String name)
      Default constructor
      • attack: 0
      • defence: 0
      • hp: 0
      Parameters:
      name - Name of the item
  • Method Details

    • getAttack

      public int getAttack()
      Description copied from interface: Usable
      Get the additional attack value.
      Specified by:
      getAttack in interface Usable
      Returns:
      additional attack value.
    • getDefence

      public int getDefence()
      Description copied from interface: Usable
      Get the additional defence value.
      Specified by:
      getDefence in interface Usable
      Returns:
      additional defence value.
    • getHp

      public int getHp()
      Description copied from interface: Usable
      Get the additional hp value.
      Specified by:
      getHp in interface Usable
      Returns:
      additional hp value.
    • setAdditionalAttack

      public void setAdditionalAttack(int atk)
      Description copied from interface: Usable
      Set additional attack value. This value will be added to the current attack value of the player.
      Specified by:
      setAdditionalAttack in interface Usable
      Parameters:
      atk - Additional attack value.
    • setAdditionalDefence

      public void setAdditionalDefence(int def)
      Description copied from interface: Usable
      Set additional defence value. This value will be added to the current defence value of the player.
      Specified by:
      setAdditionalDefence in interface Usable
      Parameters:
      def - Additional defence value.
    • setAdditionalHp

      public void setAdditionalHp(int hp)
      Description copied from interface: Usable
      Set additional hp value. This value will be added to the current hp value of the player.
      Specified by:
      setAdditionalHp in interface Usable
      Parameters:
      hp - Additional hp value.
    • toString

      public String toString()
      Overrides:
      toString in class Item
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Item