Package com.epicbot.api.shared.model
Class Tile
- java.lang.Object
-
- com.epicbot.api.shared.model.Tile
-
- All Implemented Interfaces:
Actionable
,Clickable
,Interactable
,Locatable
,Renderable
,Validatable
public class Tile extends java.lang.Object implements Locatable, Interactable, Validatable
-
-
Field Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
click(boolean rightClick)
Click on the entity.boolean
contains(java.awt.Point point)
Determines if this entity contains the given point.void
draw(java.awt.Graphics2D g2d)
Renders this entity onto the given graphics.boolean
equals(java.lang.Object obj)
java.util.List<java.lang.String>
getActions()
Gets the available actions.java.awt.Polygon
getBounds()
java.awt.Point
getCentralPoint()
Gets the central point within the entity calculated using only visible model points.java.awt.Polygon
getClickBounds()
Tile
getLocation()
Gets the tile that this entity is located on in the world.int
getPlane()
Gets the z-coordinate, also known as the floor or level.java.awt.Point
getPoint(double x, double y, int plane)
java.awt.Point
getRandomPoint()
Get a random point within the entity.java.awt.Point
getRealCentralPoint()
Gets the central point within the entity calculated using visible and non-visible model points.SceneOffset
getSceneOffset()
Gets the scene offset for this entity.int
getX()
Gets the x-coordinate.int
getY()
Gets the y-coordinate.boolean
hasAction(java.lang.String... actions)
Determines if this entity has one of the given actions.int
hashCode()
boolean
hover()
Hover on the entity.boolean
interact(int opcode)
Interacts with the entity using the specified menu action opcode.boolean
interact(java.lang.String action)
Interacts with the entity.boolean
interact(java.lang.String action, java.lang.String option)
Interacts with the entity.static boolean
isBlocked(int flag)
boolean
isValid()
Verifies whether this entity is valid and still exists.boolean
isVisible()
Gets if this entity is visible on screen.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.epicbot.api.shared.entity.details.Actionable
hasActionMatch
-
Methods inherited from interface com.epicbot.api.shared.entity.details.Interactable
interact, interact, interactMatch
-
Methods inherited from interface com.epicbot.api.shared.entity.details.Locatable
canReach, canReach, canReach, derive, derive, distanceTo, distanceTo, getArea, getArea, getMapPoint, isOnMap, randomize, randomize, randomize
-
-
-
-
Field Detail
-
OPEN
public static final int OPEN
- See Also:
- Constant Field Values
-
CLOSED
public static final int CLOSED
- See Also:
- Constant Field Values
-
WALL_NORTHWEST
public static final int WALL_NORTHWEST
- See Also:
- Constant Field Values
-
WALL_NORTH
public static final int WALL_NORTH
- See Also:
- Constant Field Values
-
WALL_NORTHEAST
public static final int WALL_NORTHEAST
- See Also:
- Constant Field Values
-
WALL_EAST
public static final int WALL_EAST
- See Also:
- Constant Field Values
-
WALL_SOUTHEAST
public static final int WALL_SOUTHEAST
- See Also:
- Constant Field Values
-
WALL_SOUTH
public static final int WALL_SOUTH
- See Also:
- Constant Field Values
-
WALL_SOUTHWEST
public static final int WALL_SOUTHWEST
- See Also:
- Constant Field Values
-
WALL_WEST
public static final int WALL_WEST
- See Also:
- Constant Field Values
-
WALL_BLOCK_NORTHWEST
public static final int WALL_BLOCK_NORTHWEST
- See Also:
- Constant Field Values
-
WALL_BLOCK_NORTH
public static final int WALL_BLOCK_NORTH
- See Also:
- Constant Field Values
-
WALL_BLOCK_NORTHEAST
public static final int WALL_BLOCK_NORTHEAST
- See Also:
- Constant Field Values
-
WALL_BLOCK_EAST
public static final int WALL_BLOCK_EAST
- See Also:
- Constant Field Values
-
WALL_BLOCK_SOUTHEAST
public static final int WALL_BLOCK_SOUTHEAST
- See Also:
- Constant Field Values
-
WALL_BLOCK_SOUTH
public static final int WALL_BLOCK_SOUTH
- See Also:
- Constant Field Values
-
WALL_BLOCK_SOUTHWEST
public static final int WALL_BLOCK_SOUTHWEST
- See Also:
- Constant Field Values
-
WALL_BLOCK_WEST
public static final int WALL_BLOCK_WEST
- See Also:
- Constant Field Values
-
WALL_ALLOW_RANGE_NORTHWEST
public static final int WALL_ALLOW_RANGE_NORTHWEST
- See Also:
- Constant Field Values
-
WALL_ALLOW_RANGE_NORTH
public static final int WALL_ALLOW_RANGE_NORTH
- See Also:
- Constant Field Values
-
WALL_ALLOW_RANGE_NORTHEAST
public static final int WALL_ALLOW_RANGE_NORTHEAST
- See Also:
- Constant Field Values
-
WALL_ALLOW_RANGE_EAST
public static final int WALL_ALLOW_RANGE_EAST
- See Also:
- Constant Field Values
-
WALL_ALLOW_RANGE_SOUTHEAST
public static final int WALL_ALLOW_RANGE_SOUTHEAST
- See Also:
- Constant Field Values
-
WALL_ALLOW_RANGE_SOUTH
public static final int WALL_ALLOW_RANGE_SOUTH
- See Also:
- Constant Field Values
-
WALL_ALLOW_RANGE_SOUTHWEST
public static final int WALL_ALLOW_RANGE_SOUTHWEST
- See Also:
- Constant Field Values
-
WALL_ALLOW_RANGE_WEST
public static final int WALL_ALLOW_RANGE_WEST
- See Also:
- Constant Field Values
-
OBJECT_ALLOW_RANGE
public static final int OBJECT_ALLOW_RANGE
- See Also:
- Constant Field Values
-
BLOCKED_OBJECT
public static final int BLOCKED_OBJECT
- See Also:
- Constant Field Values
-
BLOCKED_FLOOR_DECORATION
public static final int BLOCKED_FLOOR_DECORATION
- See Also:
- Constant Field Values
-
BLOCKED_FLOOR
public static final int BLOCKED_FLOOR
- See Also:
- Constant Field Values
-
BLOCKED
public static final int BLOCKED
- See Also:
- Constant Field Values
-
BLOCKED_LINE_OF_SIGHT_NORTH
public static final int BLOCKED_LINE_OF_SIGHT_NORTH
- See Also:
- Constant Field Values
-
BLOCKED_LINE_OF_SIGHT_EAST
public static final int BLOCKED_LINE_OF_SIGHT_EAST
- See Also:
- Constant Field Values
-
BLOCKED_LINE_OF_SIGHT_SOUTH
public static final int BLOCKED_LINE_OF_SIGHT_SOUTH
- See Also:
- Constant Field Values
-
BLOCKED_LINE_OF_SIGHT_WEST
public static final int BLOCKED_LINE_OF_SIGHT_WEST
- See Also:
- Constant Field Values
-
BLOCKED_LINE_OF_SIGHT
public static final int BLOCKED_LINE_OF_SIGHT
- See Also:
- Constant Field Values
-
-
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 interfaceValidatable
- Returns:
- true if it's still valid, false otherwise
-
getX
public int getX()
Description copied from interface:Locatable
Gets the x-coordinate.
-
getY
public int getY()
Description copied from interface:Locatable
Gets the y-coordinate.
-
getPlane
public int getPlane()
Description copied from interface:Locatable
Gets the z-coordinate, also known as the floor or level.
-
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 interfaceLocatable
- Returns:
Tile
-
getSceneOffset
public SceneOffset getSceneOffset()
Description copied from interface:Locatable
Gets the scene offset for this entity.- Specified by:
getSceneOffset
in interfaceLocatable
- Returns:
SceneOffset
-
isVisible
public boolean isVisible()
Description copied from interface:Renderable
Gets if this entity is visible on screen.- Specified by:
isVisible
in interfaceRenderable
- Returns:
- true if visible, false otherwise
-
click
public boolean click(boolean rightClick)
Description copied from interface:Clickable
Click on the entity.
-
interact
public boolean interact(java.lang.String action)
Description copied from interface:Interactable
Interacts with the entity.- Specified by:
interact
in interfaceInteractable
- 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 interfaceInteractable
- 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 interfaceInteractable
- 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.
-
getCentralPoint
public java.awt.Point getCentralPoint()
Description copied from interface:Renderable
Gets the central point within the entity calculated using only visible model points.- Specified by:
getCentralPoint
in interfaceRenderable
- Returns:
Point
- See Also:
Model.getCentralPoint(int, int, int, int, int)
-
getRealCentralPoint
public java.awt.Point getRealCentralPoint()
Description copied from interface:Renderable
Gets the central point within the entity calculated using visible and non-visible model points.- Specified by:
getRealCentralPoint
in interfaceRenderable
- Returns:
Point
- See Also:
Model.getRealCentralPoint(int, int, int, int, int)
-
getRandomPoint
public java.awt.Point getRandomPoint()
Description copied from interface:Renderable
Get a random point within the entity.- Specified by:
getRandomPoint
in interfaceRenderable
- 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 interfaceRenderable
- 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 interfaceRenderable
- Parameters:
g2d
- the graphics
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getActions
public java.util.List<java.lang.String> getActions()
Description copied from interface:Actionable
Gets the available actions.- Specified by:
getActions
in interfaceActionable
- 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 interfaceActionable
- Parameters:
actions
- one or multiple actions- Returns:
- true if it has one of the given actions, false otherwise
-
-