Interface EntityView<T extends IEntity>

Type Parameters:
T - type of the entity
All Superinterfaces:
Inspectable
All Known Implementing Classes:
Entity2DView, FlyOverArea2DView, StackableItem2DView

public interface EntityView<T extends IEntity> extends Inspectable
The view of an entity.
  • 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

      void onAction(ActionType at)
      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

      void draw(Graphics2D g2d)
    • getZIndex

      int getZIndex()
    • drawTop

      void drawTop(Graphics2D g2d)
    • setContained

      void setContained(boolean b)
    • setVisibleScreenArea

      void setVisibleScreenArea(Rectangle area)
    • initialize

      void initialize(T entity)
    • 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.