Class Entity

    • Constructor Detail

      • Entity

        public Entity​(java.lang.Object reference)
    • Method Detail

      • isOnScreen

        public boolean isOnScreen()
        Checks whether the entity is visible on the game screen
        Returns:
        true if the entity is visible
      • getBoundingBox

        public java.awt.Rectangle getBoundingBox()
        Gets the bounding box for the entity's model
        Returns:
        bounding box of model
      • getReference

        public java.lang.Object getReference()
        Gets the object used as the reflection reference.
        Returns:
        The object reference passed from the client.
      • getTileReference

        public TileReference getTileReference()
        Description copied from interface: Locatable
        Gets tile reference of the given object.
        Specified by:
        getTileReference in interface Locatable
        Returns:
        the object tile reference.
      • getModel

        public abstract Model getModel()
        Gets the model of the entity
        Returns:
        model of entity
      • getRenderableHeight

        public abstract int getRenderableHeight()
      • getName

        public abstract java.lang.String getName()
        Gets the name of the entity
        Specified by:
        getName in interface Identifiable
        Returns:
        name of entity
      • hasAction

        public abstract boolean hasAction​(java.lang.String... actions)
        Checks whether given actions are in the list of menu actions for an entity
        Parameters:
        actions - actions to check
        Returns:
        true if all actions are in the list of menu actions
      • getTile

        public Tile getTile()
        Description copied from interface: Locatable
        Gets tile of the object.
        Specified by:
        getTile in interface Locatable
        Returns:
        the object tile.
      • distance

        public double distance​(Tile tile)
        Description copied from interface: Locatable
        Distance (as the crow flies) away from the given tile.
        Specified by:
        distance in interface Locatable
        Parameters:
        tile - the destination tile.
        Returns:
        return the distance from the given tile as a double.
      • distance

        public double distance()
      • distance

        public double distance​(Entity entity)
        Distance away from the given entity.
        Parameters:
        entity - the destination target.
        Returns:
        return the distance from the given entities tile as a double.
      • walkingDistance

        public double walkingDistance​(Tile tile)
        Description copied from interface: Locatable
        Walking distance based on path finding away from the given tile. This is more expensive of a call than distance, and should be used sparingly.
        Specified by:
        walkingDistance in interface Locatable
        Parameters:
        tile - the destination tile.
        Returns:
        return the path distance movement cost from the given tile as a double. If there isn't a path to the tile, it will return 3 times the as the crow flies distance.
      • getClickablePoint

        public java.awt.Point getClickablePoint()
        Description copied from class: Interactable
        Gets a clickable point within the object, used for interaction.
        Specified by:
        getClickablePoint in class Interactable
        Returns:
        a clickable point within the object.
      • getCenterPoint

        public java.awt.Point getCenterPoint()
        Description copied from class: Interactable
        Gets center point of the object, which is used as a base location.
        Specified by:
        getCenterPoint in class Interactable
        Returns:
        the center point of the given object.
      • interact

        public boolean interact​(Filter<java.lang.String> filter)
        Description copied from class: Interactable
        Interacts with the given object using the first matching action.
        Overrides:
        interact in class Interactable
        Parameters:
        filter - the action filter
        Returns:
        results of interaction, true if interaction with the object was successful, otherwise false.
      • exists

        public boolean exists()
        Description copied from interface: Verified
        Determines where or not this object exists in game.
        Specified by:
        exists in interface Verified
        Returns:
        true, if the object exist, otherwise false.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getSurroundingArea

        public Area getSurroundingArea​(int radius)
      • canReach

        public boolean canReach()
        Description copied from interface: Locatable
        Checks if this location is reachable by the local player without obstacles
        Specified by:
        canReach in interface Locatable
        Returns:
        true if it can, false otherwise
      • getActions

        public abstract java.lang.String[] getActions()