public class Tile extends java.lang.Object implements Locatable, Interactable, Validatable
Constructor and Description |
---|
Tile(int x,
int y) |
Tile(int x,
int y,
int plane) |
Modifier and Type | Method and 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() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
canReach, canReach, canReach, derive, derive, distanceTo, distanceTo, getArea, getArea, getMapPoint, isOnMap, randomize, randomize, randomize
interact, interact, interactMatch
hasActionMatch
public static final int OPEN
public static final int CLOSED
public static final int WALL_NORTHWEST
public static final int WALL_NORTH
public static final int WALL_NORTHEAST
public static final int WALL_EAST
public static final int WALL_SOUTHEAST
public static final int WALL_SOUTH
public static final int WALL_SOUTHWEST
public static final int WALL_WEST
public static final int WALL_BLOCK_NORTHWEST
public static final int WALL_BLOCK_NORTH
public static final int WALL_BLOCK_NORTHEAST
public static final int WALL_BLOCK_EAST
public static final int WALL_BLOCK_SOUTHEAST
public static final int WALL_BLOCK_SOUTH
public static final int WALL_BLOCK_SOUTHWEST
public static final int WALL_BLOCK_WEST
public static final int WALL_ALLOW_RANGE_NORTHWEST
public static final int WALL_ALLOW_RANGE_NORTH
public static final int WALL_ALLOW_RANGE_NORTHEAST
public static final int WALL_ALLOW_RANGE_EAST
public static final int WALL_ALLOW_RANGE_SOUTHEAST
public static final int WALL_ALLOW_RANGE_SOUTH
public static final int WALL_ALLOW_RANGE_SOUTHWEST
public static final int WALL_ALLOW_RANGE_WEST
public static final int OBJECT_ALLOW_RANGE
public static final int BLOCKED_OBJECT
public static final int BLOCKED_FLOOR_DECORATION
public static final int BLOCKED_FLOOR
public static final int BLOCKED
public static final int BLOCKED_LINE_OF_SIGHT_NORTH
public static final int BLOCKED_LINE_OF_SIGHT_EAST
public static final int BLOCKED_LINE_OF_SIGHT_SOUTH
public static final int BLOCKED_LINE_OF_SIGHT_WEST
public static final int BLOCKED_LINE_OF_SIGHT
public static boolean isBlocked(int flag)
public boolean isValid()
Validatable
isValid
in interface Validatable
public int getX()
Locatable
public int getY()
Locatable
public int getPlane()
Locatable
public Tile getLocation()
Locatable
getLocation
in interface Locatable
Tile
public SceneOffset getSceneOffset()
Locatable
getSceneOffset
in interface Locatable
SceneOffset
public boolean isVisible()
Renderable
isVisible
in interface Renderable
public boolean click(boolean rightClick)
Clickable
public boolean interact(java.lang.String action)
Interactable
interact
in interface Interactable
action
- the action to selectpublic boolean interact(java.lang.String action, java.lang.String option)
Interactable
interact
in interface Interactable
action
- the action to select (e.g. Bank)option
- the option to select (e.g. Bank booth)public boolean interact(int opcode)
Interactable
interact
in interface Interactable
opcode
- the menu action op code (e.g. 1005 for "Walk here")public boolean hover()
Clickable
public java.awt.Point getCentralPoint()
Renderable
getCentralPoint
in interface Renderable
Point
Model.getCentralPoint(int, int, int, int, int)
public java.awt.Point getRealCentralPoint()
Renderable
getRealCentralPoint
in interface Renderable
Point
Model.getRealCentralPoint(int, int, int, int, int)
public java.awt.Point getRandomPoint()
Renderable
getRandomPoint
in interface Renderable
Point
public java.awt.Point getPoint(double x, double y, int plane)
public java.awt.Polygon getClickBounds()
public java.awt.Polygon getBounds()
public boolean contains(java.awt.Point point)
Renderable
contains
in interface Renderable
point
- the pointpublic void draw(java.awt.Graphics2D g2d)
Renderable
draw
in interface Renderable
g2d
- the graphicspublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<java.lang.String> getActions()
Actionable
getActions
in interface Actionable
public boolean hasAction(java.lang.String... actions)
Actionable
hasAction
in interface Actionable
actions
- one or multiple actions