Package com.deco2800.game.components
Class EntityDirectionComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.EntityDirectionComponent
Used to keep record of the position that moving units such as enemies, friendlies
and workers, it uses an EnemyDirection enumeration class for each compass direction
and EnemyDirection.DEFAULT which is only set upon initialising the class, this to stop
avoid using null for direction when component is first initialised.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the direction the unit is facing invoid
Sets enemy direction to eastvoid
Sets enemy direction to northvoid
Sets enemy direction to southvoid
Sets enemy direction to westMethods inherited from class com.deco2800.game.components.Component
create, dispose, earlyUpdate, getEntity, isAnimationRenderComponent, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
EntityDirectionComponent
public EntityDirectionComponent()
-
-
Method Details
-
getEntityDirection
Returns the direction the unit is facing in- Returns:
- the direction unit is facing in
-
setDirectionNorth
public void setDirectionNorth()Sets enemy direction to north -
setDirectionSouth
public void setDirectionSouth()Sets enemy direction to south -
setDirectionEast
public void setDirectionEast()Sets enemy direction to east -
setDirectionWest
public void setDirectionWest()Sets enemy direction to west
-