java.lang.Object
com.adventure.models.Entity
com.adventure.models.Player
Player entity.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks whether the player is fighting or notvoid
setFightingStatus
(boolean status) Set the fighting status of the playervoid
Method implemented to use an item.Methods inherited from class com.adventure.models.Entity
equals, getAlive, getAttackDamage, getAvailableDodges, getInventory, getName, getStats, heal, hit, resetDodge, setAlive, setInventory, setName, setStats, useDodge
-
Constructor Details
-
Player
Player constructor.- Parameters:
name
- Player name.inventory
- Inventory name.stats
- Player stats.
-
-
Method Details
-
use
Method implemented to use an item.- Parameters:
itemName
- Item to use.- Throws:
NoSuchElementException
NotUsableItemException
-
isFighting
public boolean isFighting()Checks whether the player is fighting or not- Returns:
- true if the player is fighting, false otherwise
-
setFightingStatus
public void setFightingStatus(boolean status) Set the fighting status of the player- Parameters:
status
- boolean fight status
-