Interface EntityView<T extends IEntity>
- Type Parameters:
T- type of the entity
- All Superinterfaces:
Inspectable
- All Known Implementing Classes:
Entity2DView,FlyOverArea2DView,Item2DView,TrainingDummy2DView
The view of an entity.
-
Method Summary
Modifier and TypeMethodDescriptionvoidUpdate the view with the changes in entity.voiddraw(Graphics2D g2d) voiddrawTop(Graphics2D g2d) String[]Get the list of actions.getArea()gets the mouse cursor image to use for this entity.Get the view's entity.intvoidinitialize(T entity) booleanis this entity interactive so that the player can click or move it?booleanDetermine if this entity can be moved (e.g.voidonAction()Perform the default action.voidonAction(ActionType at) Perform an action.booleanPerform the default action unless it is not safe.voidrelease()Release any view resources.voidsetContained(boolean b) voidMethods 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:
trueif 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:
trueif the action was performed,falseif 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.
-