Class MovableEntity

  • All Implemented Interfaces:
    Entity
    Direct Known Subclasses:
    GreedyEntity

    public abstract class MovableEntity
    extends BasicEntity
    A movable entity
    Author:
    Tim Neumann
    • Constructor Detail

      • MovableEntity

        public MovableEntity()
    • Method Detail

      • turnClockWise

        public void turnClockWise()
        Turn this entity for 90 degrees in clock wise direction.
      • getLookingDirection

        public Direction getLookingDirection()
        Returns:
        the current looking direction of this entity
      • getLookingDirectionString

        @InspectionAttribute(name="LookingDirection")
        public String getLookingDirectionString()
        Returns:
        the looking direction as a string
      • canMove

        public boolean canMove()
        Returns:
        whether this entity can move forward one field.
      • moveIfPossible

        public void moveIfPossible()
        Move this entity forward one field if that is possible.