java.lang.Object
com.adventure.models.items.Item
com.adventure.models.items.UsableItem
- All Implemented Interfaces:
Usable
Usable item. Gives some boost or nerf.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Get the additional attack value.int
Get the additional defence value.int
getHp()
Get the additional hp value.void
setAdditionalAttack
(int atk) Set additional attack value.void
setAdditionalDefence
(int def) Set additional defence value.void
setAdditionalHp
(int hp) Set additional hp value.toString()
-
Constructor Details
-
UsableItem
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. -
getDefence
public int getDefence()Description copied from interface:Usable
Get the additional defence value.- Specified by:
getDefence
in interfaceUsable
- Returns:
- additional defence value.
-
getHp
public int getHp()Description copied from interface:Usable
Get the 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 interfaceUsable
- 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 interfaceUsable
- 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 interfaceUsable
- Parameters:
hp
- Additional hp value.
-
toString
-
equals
-