Class MovableEntity
- java.lang.Object
-
- de.unistuttgart.informatik.fius.icge.simulation.entity.BasicEntity
-
- de.unistuttgart.informatik.fius.icge.simulation.entity.MovableEntity
-
- All Implemented Interfaces:
Entity
- Direct Known Subclasses:
GreedyEntity
public abstract class MovableEntity extends BasicEntity
A movable entity- Author:
- Tim Neumann
-
-
Field Summary
-
Fields inherited from class de.unistuttgart.informatik.fius.icge.simulation.entity.BasicEntity
endOfLastEnqueuedOperation
-
-
Constructor Summary
Constructors Constructor Description MovableEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanMove()DrawablegetDrawInformation()DirectiongetLookingDirection()StringgetLookingDirectionString()voidmove()Move this entity forward one field.voidmoveIfPossible()Move this entity forward one field if that is possible.voidturnClockWise()Turn this entity for 90 degrees in clock wise direction.-
Methods inherited from class de.unistuttgart.informatik.fius.icge.simulation.entity.BasicEntity
enqueueToPerformNewOperation, getPlayfield, getPosition, getSimulation, getTextureHandle, getZPosition, initOnPlayfield, isOnPlayfield, sleep, toString
-
-
-
-
Method Detail
-
getDrawInformation
public Drawable getDrawInformation()
- Specified by:
getDrawInformationin interfaceEntity- Overrides:
getDrawInformationin classBasicEntity- Returns:
- the information required to draw this entity; must not be null
-
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
-
move
public void move()
Move this entity forward one field.- Throws:
EntityNotOnFieldException- if this entity is not on a playfieldIllegalMoveException- if a solid entity is in the way
-
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.
-
-