public class MoverModel extends AbilityModel<MoverListener,MoverUsedServices> implements MoverServices, MoverListener
listeners, user
Constructor and Description |
---|
MoverModel(MoverUsedServices user,
MapTileStrategy<?,?,?> map)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clearIgnoredId() |
void |
clearSharedPathIds() |
int |
getLocationInTileX() |
int |
getLocationInTileY() |
Orientation |
getMovementOrientation()
Get the current orientation when moving.
|
double |
getMoveX() |
double |
getMoveY() |
double |
getSpeedX() |
double |
getSpeedY() |
boolean |
isDestinationReached() |
boolean |
isIgnoredId(Integer id) |
boolean |
isMoving() |
boolean |
isPathAvailable(int dtx,
int dty) |
void |
notifyArrived()
Notify listener when mover has arrived.
|
void |
notifyMoving()
Notify listener while mover is moving.
|
void |
notifyStartMove()
Notify listener when mover starting to move.
|
void |
pointTo(int dtx,
int dty)
Adjust orientation to face to specified tile.
|
void |
pointTo(Tiled tiled)
Adjust orientation to face to specified entity.
|
void |
setDestination(double extrp,
double dx,
double dy) |
boolean |
setDestination(int dtx,
int dty) |
void |
setDestination(Tiled tiled)
Assign a specified location; will move automatically until reach it.
|
void |
setIgnoreId(Integer id,
boolean state) |
void |
setLocation(int dtx,
int dty) |
void |
setSharedPathIds(Set<Integer> ids) |
void |
setSpeed(double speedX,
double speedY) |
void |
stopMoves() |
void |
updateMoves(double extrp) |
addListener, removeListener
public MoverModel(MoverUsedServices user, MapTileStrategy<?,?,?> map)
user
- The user reference.map
- The map reference.public Orientation getMovementOrientation()
MoverServices
getMovementOrientation
in interface MoverServices
public void setDestination(Tiled tiled)
MoverServices
setDestination
in interface MoverServices
tiled
- The tiled to reachpublic void pointTo(int dtx, int dty)
MoverServices
pointTo
in interface MoverServices
dtx
- The horizontal tile to face.dty
- The vertical tile to face.public void pointTo(Tiled tiled)
MoverServices
pointTo
in interface MoverServices
tiled
- The tiled to face to.public void setDestination(double extrp, double dx, double dy)
setDestination
in interface Pathfindable
public boolean setDestination(int dtx, int dty)
setDestination
in interface Pathfindable
public boolean isPathAvailable(int dtx, int dty)
isPathAvailable
in interface Pathfindable
public void setLocation(int dtx, int dty)
setLocation
in interface Pathfindable
public void setIgnoreId(Integer id, boolean state)
setIgnoreId
in interface Pathfindable
public boolean isIgnoredId(Integer id)
isIgnoredId
in interface Pathfindable
public void clearIgnoredId()
clearIgnoredId
in interface Pathfindable
public void setSharedPathIds(Set<Integer> ids)
setSharedPathIds
in interface Pathfindable
public void clearSharedPathIds()
clearSharedPathIds
in interface Pathfindable
public void updateMoves(double extrp)
updateMoves
in interface Pathfindable
public void stopMoves()
stopMoves
in interface Pathfindable
public void setSpeed(double speedX, double speedY)
setSpeed
in interface Pathfindable
public boolean isMoving()
isMoving
in interface Pathfindable
public boolean isDestinationReached()
isDestinationReached
in interface Pathfindable
public double getSpeedX()
getSpeedX
in interface Pathfindable
public double getSpeedY()
getSpeedY
in interface Pathfindable
public double getMoveX()
getMoveX
in interface Pathfindable
public double getMoveY()
getMoveY
in interface Pathfindable
public int getLocationInTileX()
getLocationInTileX
in interface Pathfindable
public int getLocationInTileY()
getLocationInTileY
in interface Pathfindable
public void notifyStartMove()
MoverListener
notifyStartMove
in interface MoverListener
public void notifyMoving()
MoverListener
notifyMoving
in interface MoverListener
public void notifyArrived()
MoverListener
notifyArrived
in interface MoverListener
Copyright © 2014 Byron 3D Games Studio. All rights reserved.