Interface EntityView<T extends IEntity>
- Type Parameters:
T
- type of the entity
- All Superinterfaces:
Inspectable
- All Known Implementing Classes:
Entity2DView
,FlyOverArea2DView
,StackableItem2DView
The view of an entity.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Update the view with the changes in entity.void
draw(Graphics2D g2d)
void
drawTop(Graphics2D g2d)
String[]
Get the list of actions.getArea()
gets the mouse cursor image to use for this entity.Get the view's entity.int
void
initialize(T entity)
boolean
is this entity interactive so that the player can click or move it?boolean
Determine if this entity can be moved (e.g.void
onAction()
Perform the default action.void
onAction(ActionType at)
Perform an action.boolean
Perform the default action unless it is not safe.void
release()
Release any view resources.void
setContained(boolean b)
void
setVisibleScreenArea(Rectangle area)
Methods inherited from interface games.stendhal.client.gui.Inspectable
setInspector
-
Method Details
-
getActions
String[] getActions()Get the list of actions.- Returns:
- The list of actions.
-
getEntity
T getEntity()Get the view's entity.- Returns:
- The view's entity.
-
isMovable
boolean isMovable()Determine if this entity can be moved (e.g. via dragging).- Returns:
true
if the entity is movable.
-
onAction
void onAction()Perform the default action. -
onAction
Perform an action.- Parameters:
at
- The action.
-
onHarmlessAction
boolean onHarmlessAction()Perform the default action unless it is not safe.- Returns:
true
if the action was performed,false
if nothing was done
-
release
void release()Release any view resources. This view should not be used after this is called. -
getArea
Rectangle getArea() -
draw
-
getZIndex
int getZIndex() -
drawTop
-
setContained
void setContained(boolean b) -
setVisibleScreenArea
-
initialize
-
isInteractive
boolean isInteractive()is this entity interactive so that the player can click or move it?- Returns:
- true if the player can interact with it, false otherwise.
-
getCursor
StendhalCursor getCursor()gets the mouse cursor image to use for this entity.- Returns:
- StendhalCursor
-
applyChanges
void applyChanges()Update the view with the changes in entity.
-