Class Tile

    • Constructor Detail

      • Tile

        public Tile​(int x,
                    int y)
      • Tile

        public Tile​(int x,
                    int y,
                    int plane)
    • Method Detail

      • isBlocked

        public static boolean isBlocked​(int flag)
      • isValid

        public boolean isValid()
        Description copied from interface: Validatable
        Verifies whether this entity is valid and still exists.
        Specified by:
        isValid in interface Validatable
        Returns:
        true if it's still valid, false otherwise
      • getX

        public int getX()
        Description copied from interface: Locatable
        Gets the x-coordinate.
        Specified by:
        getX in interface Locatable
        Returns:
        int
      • getY

        public int getY()
        Description copied from interface: Locatable
        Gets the y-coordinate.
        Specified by:
        getY in interface Locatable
        Returns:
        int
      • getPlane

        public int getPlane()
        Description copied from interface: Locatable
        Gets the z-coordinate, also known as the floor or level.
        Specified by:
        getPlane in interface Locatable
        Returns:
        int
      • getLocation

        public Tile getLocation()
        Description copied from interface: Locatable
        Gets the tile that this entity is located on in the world.
        Specified by:
        getLocation in interface Locatable
        Returns:
        Tile
      • isVisible

        public boolean isVisible()
        Description copied from interface: Renderable
        Gets if this entity is visible on screen.
        Specified by:
        isVisible in interface Renderable
        Returns:
        true if visible, false otherwise
      • click

        public boolean click​(boolean rightClick)
        Description copied from interface: Clickable
        Click on the entity.
        Specified by:
        click in interface Clickable
        Parameters:
        rightClick - true to use the right mouse button to click
        Returns:
        true if the click succeeded, false otherwise
      • interact

        public boolean interact​(java.lang.String action)
        Description copied from interface: Interactable
        Interacts with the entity.
        Specified by:
        interact in interface Interactable
        Parameters:
        action - the action to select
        Returns:
        true if the interaction succeeded, false otherwise
      • interact

        public boolean interact​(java.lang.String action,
                                java.lang.String option)
        Description copied from interface: Interactable
        Interacts with the entity.
        Specified by:
        interact in interface Interactable
        Parameters:
        action - the action to select (e.g. Bank)
        option - the option to select (e.g. Bank booth)
        Returns:
        true if the interaction succeeded, false otherwise
      • interact

        public boolean interact​(int opcode)
        Description copied from interface: Interactable
        Interacts with the entity using the specified menu action opcode.
        Specified by:
        interact in interface Interactable
        Parameters:
        opcode - the menu action op code (e.g. 1005 for "Walk here")
        Returns:
        true if the interaction succeeded, false otherwise
      • hover

        public boolean hover()
        Description copied from interface: Clickable
        Hover on the entity.
        Specified by:
        hover in interface Clickable
        Returns:
        true if the hover succeeded, false otherwise
      • getRandomPoint

        public java.awt.Point getRandomPoint()
        Description copied from interface: Renderable
        Get a random point within the entity.
        Specified by:
        getRandomPoint in interface Renderable
        Returns:
        Point
      • getPoint

        public java.awt.Point getPoint​(double x,
                                       double y,
                                       int plane)
      • getClickBounds

        public java.awt.Polygon getClickBounds()
      • getBounds

        public java.awt.Polygon getBounds()
      • contains

        public boolean contains​(java.awt.Point point)
        Description copied from interface: Renderable
        Determines if this entity contains the given point.
        Specified by:
        contains in interface Renderable
        Parameters:
        point - the point
        Returns:
        true if this entity contains the point, false otherwise
      • draw

        public void draw​(java.awt.Graphics2D g2d)
        Description copied from interface: Renderable
        Renders this entity onto the given graphics.
        Specified by:
        draw in interface Renderable
        Parameters:
        g2d - the graphics
      • equals

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getActions

        public java.util.List<java.lang.String> getActions()
        Description copied from interface: Actionable
        Gets the available actions.
        Specified by:
        getActions in interface Actionable
        Returns:
        list of actions
      • hasAction

        public boolean hasAction​(java.lang.String... actions)
        Description copied from interface: Actionable
        Determines if this entity has one of the given actions.
        Specified by:
        hasAction in interface Actionable
        Parameters:
        actions - one or multiple actions
        Returns:
        true if it has one of the given actions, false otherwise