Class StateEntity

All Implemented Interfaces:
Collidable
Direct Known Subclasses:
Player

public abstract class StateEntity extends Entity
This class represents a special kind of Entity, a Entity with inner state. All will be managed by this State.
Author:
Dominik Fuchss
  • Constructor Details

    • StateEntity

      protected StateEntity(Vec startPos, Vec vel, Vec size, Team team)
      Constructor that initializes attributes and takes a start position.
      Parameters:
      startPos - the position this entity shall be in
      vel - the velocity
      size - the size
      team - the team
  • Method Details

    • setEntityState

      public final void setEntityState(EntityState value)
      Set the Entities EntitiyState that determines its jump behavior.
      Parameters:
      value - the new EntityState
    • getEntityState

      public final EntityState getEntityState()
      Return the Entities current EntitiyState that determines its jump behavior.
      Returns:
      the state
    • innerLogicLoop

      protected final void innerLogicLoop()
      This method will calculate the next position of the Entity depending on the velocity.
      Overrides:
      innerLogicLoop in class Entity
    • collidedWithSolid

      public void collidedWithSolid(Frame collision, Direction dir)
      Description copied from class: Entity
      This implementation will ensure that no entity is able to fall through the ground or into another Object.
      Specified by:
      collidedWithSolid in interface Collidable
      Overrides:
      collidedWithSolid in class Entity
      Parameters:
      collision - the Frame of the GameElement that was collided on
      dir - the direction of this GameElement where the collision took place