java.lang.Object
com.adventure.models.Entity
com.adventure.models.Player
Player entity.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks whether the player is fighting or notvoidsetFightingStatus(boolean status) Set the fighting status of the playervoidMethod 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:
NoSuchElementExceptionNotUsableItemException
-
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
-