com.b3dgs.lionengine.game
Class AbstractEntity

java.lang.Object
  extended by com.b3dgs.lionengine.game.purviews.Configurable
      extended by com.b3dgs.lionengine.game.Entity
          extended by com.b3dgs.lionengine.game.AbstractEntity
All Implemented Interfaces:
Collisionable, Mirrorable
Direct Known Subclasses:
AbstractPlatformEntity

public abstract class AbstractEntity
extends Entity

Describe the lowest level of an entity, able to be externally configured. This already includes location and speed handling.


Field Summary
 
Fields inherited from class com.b3dgs.lionengine.game.Entity
collisionable, height, mirrorable, width, x, xOld, y, yOld
 
Constructor Summary
AbstractEntity()
          Create a new blank entity.
AbstractEntity(Configurable configurable)
          Create a new entity from a existing configuration.
 
Method Summary
 float getSpeed()
          Get current standard speed.
 float getSpeedAdd()
          Get current additional speed.
 float getSpeedAddDest()
          Get current additional destination speed.
 float getSpeedDest()
          Get current standard destination speed.
 float getSpeedMax()
          Get the maximum speed player can reach.
 float getSpeedReal()
          Get real speed (calculated on differential location x).
 void resetAllSpeed()
          Reset all speed to 0.
 void setSize(int width, int height)
          Set entity size.
 void setSpeed(float speed)
          Set standard speed.
 void setSpeedAdd(float speed)
          Set additional speed.
 void setSpeedAddDest(float speed)
          Set additional destination speed.
 void setSpeedDest(float speed)
          Set destination speed.
 void setSpeedMax(float speed)
          Set the maximum speed player can reach.
 void setX(float x)
          Set location x.
 void setY(float y)
          Set location y.
abstract  void update(Keyboard keyboard, Mouse mouse, float extrp)
          Update routine.
 
Methods inherited from class com.b3dgs.lionengine.game.Entity
backupCoord, cancelMirror, collide, collide, getCancelMirror, getCollision, getHeight, getMirror, getRay, getWidth, getX, getXOld, getXReal, getY, getYOld, getYReal, invertYAxis, mirror, move, place, renderCollision, updateCollision, updateMirror
 
Methods inherited from class com.b3dgs.lionengine.game.purviews.Configurable
checkInstruction, getAnim, getCollArea, getData, getDataBool, getDataInt, getDataString, getRange, loadData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractEntity

public AbstractEntity()
Create a new blank entity.


AbstractEntity

public AbstractEntity(Configurable configurable)
Create a new entity from a existing configuration. This way, loaded configuration will be shared.

Parameters:
configurable - configuration reference.
Method Detail

update

public abstract void update(Keyboard keyboard,
                            Mouse mouse,
                            float extrp)
Update routine.

Parameters:
extrp - extrapolation value.
keyboard - keyboard reference.
mouse - mouse reference.

resetAllSpeed

public void resetAllSpeed()
Reset all speed to 0.


setSpeed

public void setSpeed(float speed)
Set standard speed.

Parameters:
speed - speed.

setSpeedAdd

public void setSpeedAdd(float speed)
Set additional speed.

Parameters:
speed - speed.

setSpeedDest

public void setSpeedDest(float speed)
Set destination speed.

Parameters:
speed - speed.

setSpeedAddDest

public void setSpeedAddDest(float speed)
Set additional destination speed.

Parameters:
speed - speed.

setSpeedMax

public void setSpeedMax(float speed)
Set the maximum speed player can reach.

Parameters:
speed - maximum speed.

getSpeedMax

public float getSpeedMax()
Get the maximum speed player can reach.

Returns:
maximum speed player can reach.

getSpeedReal

public float getSpeedReal()
Get real speed (calculated on differential location x).

Returns:
real speed.

getSpeed

public float getSpeed()
Get current standard speed.

Returns:
current standard speed.

getSpeedDest

public float getSpeedDest()
Get current standard destination speed.

Returns:
current standard destination speed.

getSpeedAdd

public float getSpeedAdd()
Get current additional speed.

Returns:
current additional speed.

getSpeedAddDest

public float getSpeedAddDest()
Get current additional destination speed.

Returns:
current additional destination speed.

setX

public void setX(float x)
Set location x.

Parameters:
x - location x.

setY

public void setY(float y)
Set location y.

Parameters:
y - location y.

setSize

public void setSize(int width,
                    int height)
Set entity size.

Parameters:
width - entity width.
height - entity height.