Interface Entity
-
- All Known Subinterfaces:
CollectableEntity
,SolidEntity
- All Known Implementing Classes:
BasicEntity
,GreedyEntity
,MovableEntity
public interface Entity
The interface for an entity in the simulation of the ICGE.- Author:
- Tim Neumann
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Drawable
getDrawInformation()
Position
getPosition()
void
initOnPlayfield(Playfield playfield)
Method to initialize this entity after being added to the playfield.
-
-
-
Method Detail
-
getPosition
Position getPosition()
- Returns:
- the position of this entity
-
getDrawInformation
Drawable getDrawInformation()
- Returns:
- the information required to draw this entity; must not be null
-
initOnPlayfield
void initOnPlayfield(Playfield playfield)
Method to initialize this entity after being added to the playfield.This method should not be called from anywhere other than the playfield implementation.
This method needs to be called by the playfield directly before adding the entity to the field.
- Parameters:
playfield
- The playfield this entity was added to; must not be null- Throws:
IllegalArgumentException
- if the given playfield is nullEntityOnAnotherFieldException
- if the entity is already on a field
-
-