Constructor and Description |
---|
Unit(PathBasedMap<?> map) |
Modifier and Type | Method and Description |
---|---|
void |
assignDestination(int dx,
int dy)
Assign a specified location; will move automaticaly until reach it.
|
void |
attack(Entry entry) |
void |
buildAt(int v,
int h,
Building building) |
void |
follow(Entry entry) |
float |
getSpeedX()
Get horizontal speed.
|
float |
getSpeedY()
Get vertical speed.
|
int |
getX()
Get horizontal location.
|
int |
getXInTile()
Get horizontal location in tile (location on map).
|
int |
getY()
Get vertical location.
|
int |
getYInTile()
Get vertical location in tile (location on map).
|
void |
manualMove(float dx,
float dy,
float extrp)
Move to specified destination only on call.
|
abstract void |
onArrived() |
abstract void |
onAttack() |
abstract void |
onConstructing() |
abstract void |
onDied() |
abstract void |
onHit() |
abstract void |
onMove() |
void |
place(float x,
float y)
Set specified location.
|
void |
setSpeed(float speedX,
float speedY)
Set move speed.
|
void |
stop() |
void |
update(float extrp)
Update automatic moves if has.
|
public Unit(PathBasedMap<?> map)
public void manualMove(float dx, float dy, float extrp)
PathMover
manualMove
in interface PathMover
dx
- destination x.dy
- destination y.extrp
- extrapolation value.public void assignDestination(int dx, int dy)
PathMover
assignDestination
in interface PathMover
dx
- destination x.dy
- destination y.public void buildAt(int v, int h, Building building)
public void attack(Entry entry)
public void follow(Entry entry)
public void stop()
public void place(float x, float y)
PathMover
public void update(float extrp)
PathMover
public void setSpeed(float speedX, float speedY)
PathMover
public float getSpeedX()
PathMover
public float getSpeedY()
PathMover
public int getX()
PathMover
public int getY()
PathMover
public int getXInTile()
PathMover
getXInTile
in interface PathMover
public int getYInTile()
PathMover
getYInTile
in interface PathMover
public abstract void onMove()
public abstract void onArrived()
public abstract void onAttack()
public abstract void onConstructing()
public abstract void onHit()
public abstract void onDied()