Class Player

java.lang.Object
com.adventure.models.Entity
com.adventure.models.Player

public class Player extends Entity
Player entity.
  • Constructor Details

    • Player

      public Player(String name, Inventory inventory, Stats stats)
      Player constructor.
      Parameters:
      name - Player name.
      inventory - Inventory name.
      stats - Player stats.
  • Method Details

    • use

      public void use(String itemName) throws NoSuchElementException, NotUsableItemException
      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