Class EntityDirectionComponent

java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.EntityDirectionComponent

public class EntityDirectionComponent extends Component
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.
  • Constructor Details

    • EntityDirectionComponent

      public EntityDirectionComponent()
  • Method Details

    • getEntityDirection

      public EntityDirection 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