Class GroundObjectEntity

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getId()
      The item ID for the wrapped game entity
      java.lang.String getName()
      The game entities name.
      boolean interact​(java.lang.String action)
      Interact interacts with the ground object.
      boolean isInArea​(GameArea area)
      Checks if the ground object is within the game area.
      boolean take()
      Takes an item from the ground to be placed in the players inventory.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getId

        public int getId()
        Description copied from interface: Interactable
        The item ID for the wrapped game entity
        Returns:
        int Item id
      • getName

        public java.lang.String getName()
        Description copied from interface: Interactable
        The game entities name.
        Returns:
        The name of the game entity i.e. NPC name for NPC's, item name for ContainerItem's, and GameObject name for various game objects.
      • interact

        public boolean interact​(java.lang.String action)
        Interact interacts with the ground object. This interact is slightly different from other interactions because the underlying packet object does not accept an action to take on the ground object. It is always "Take" because that is the only action you can perform to an item on the ground.

        To conform to the interface for an AbstractEntity we still accept an action parameter although it will do nothing in this particular instance.

        Parameters:
        action - The menu action to trigger (e.g. "Take")
        Returns:
        True if the interaction is successful and false otherwise
      • isInArea

        public boolean isInArea​(GameArea area)
        Checks if the ground object is within the game area.
        Parameters:
        area - The GameArea to check.
        Returns:
        True if the ground object is within the game area and false otherwise.
      • take

        public boolean take()
        Takes an item from the ground to be placed in the players inventory.
        Returns:
        True if the action was successful and false otherwise.