Class Entity

java.lang.Object
ch.epfl.cs107.play.engine.actor.Entity
All Implemented Interfaces:
Acoustics, Actor, Graphics, Updatable, Positionable
Direct Known Subclasses:
AreaEntity, Background, Foreground, GraphicsEntity, Grid, Path, Text

public abstract class Entity extends Object implements Actor
Basic Entity are simply actor and represented by a current exact position and its corresponding transform
  • Constructor Details

    • Entity

      public Entity(Vector position)
      Default Entity constructor
      Parameters:
      position - (Coordinate): Initial position of the entity. Not null
  • Method Details

    • setCurrentPosition

      protected void setCurrentPosition(Vector v)
      Update the current position (i.e. after motion) after position change, the transform need to be updated to. Hence set it to null
      Parameters:
      v - (Vector): The new Position. Not null
    • getTransform

      public Transform getTransform()
      Specified by:
      getTransform in interface Positionable
      Returns:
      (Transform): affine transform, not null
    • getPosition

      public Vector getPosition()
      Specified by:
      getPosition in interface Positionable
      Returns:
      (Vector): origin, not null
    • getVelocity

      public Vector getVelocity()
      Specified by:
      getVelocity in interface Positionable
      Returns:
      (Vector): linear velocity, not null