Class Positionable

java.lang.Object
rea.components.Component
rea.components.Positionable
All Implemented Interfaces:
Element
Direct Known Subclasses:
Character, Item, Passage

public abstract class Positionable extends Component
A positionable object in the game. The object has a Position in a Place. When created, the object lacks a specific position in a place.
Author:
José Paulo Leal jpleal@fc.up.pt
  • Constructor Details

    • Positionable

      public Positionable(Visual visual, String description)
      Create a positionable object.
      Parameters:
      visual - visual representation of the object
      description - description of the object
  • Method Details

    • moveTo

      public void moveTo(Position position)
      Move point to a new location.
      Parameters:
      position - new position
    • getPosition

      public Position getPosition()
      The position of the object in the place.
      Returns:
      the position of the object