|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cad.simcad.worldsimulator.objects.SimulatedObject | +--cad.simcad.worldsimulator.objects.units.MyUnit
Field Summary | |
protected double |
_baseTurnIncrement
|
protected double |
_boundingRadius
|
protected PathPlace |
_pp
|
protected PathPlace |
_previousOne
|
protected boolean |
_recomputing
|
protected double |
_savedMovPoints
|
protected int |
_state
state for the move method |
protected UnitControler |
_uc
|
protected UnitMediator |
_um
|
protected int |
_velocity
|
static int |
IncrementWaypoint
|
static int |
ReachedGoal
|
static int |
WaitingForPath
|
Fields inherited from class cad.simcad.worldsimulator.objects.SimulatedObject |
_am, _className, _height, _id, _name, _om, _owner, _serial, _sime, _stateId, _width |
Constructor Summary | |
MyUnit(SimEnvironment sime,
PathPlace current,
UnitMediator um,
Owner owner,
java.lang.String className)
Creates new Unit on a Map A unit has the following properties 1) It belongs to a Map, on which it is has a position 2) the position on that map 3) Owner 4) it is waiting to a Path |
Method Summary | |
void |
debug(java.lang.String msg,
int lvl)
|
void |
firePathComputed(PathPlaceSet path)
Notice the PathUser that a Path has been computed for him. |
double |
getBoundingCircleRadius()
This allows to ask the radius of the objects bounding circle. |
PathPlace |
getCurrentPathPlace()
Return the current PathPlace the PathUser is on |
int |
getHeight()
Return the y height of the object |
java.awt.Color |
getMiniMapColor()
Return the Color for a totally zoomed out view |
java.lang.String |
getObjectType()
Return the Type of the SimObject |
Owner |
getOwner()
|
UnitControler |
getUnitControler()
|
int |
getVelocity()
Here the velocity of an object can be asked. |
int |
getWidth()
Return the x width of the object |
int |
getX()
Return the X coordinate where the object should be drawn |
int |
getY()
Return the Y coordinate where the object should be drawn |
boolean |
isCollision(PathPlace mp)
Returns true if the Unit goes in collision if it moves on the PathPlace mp |
void |
move()
Top of movement state loop: { If we're in IncrementWaypoint state: Increment our waypoint. |
void |
resolveNewMove(PathPlace m)
the map place that couldn't be reached |
void |
setState(int i)
|
void |
setVelocity(int value)
To change the velocity of an object. |
void |
stopObject()
Stop the object activity |
void |
stopUnit()
|
void |
takeTurn()
This method returns the object name. |
protected void |
updateStateId(PathPlace from,
PathPlace to)
|
Methods inherited from class cad.simcad.worldsimulator.objects.SimulatedObject |
getClassName, getId, getName, getSerialNumber, getStateId, setStateId |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cad.simcad.objectserver.spec.pathfinding.PathUser |
getDeformFactor, getId, getMaxSteepNessRatio, getName |
Field Detail |
public static final int IncrementWaypoint
public static final int ReachedGoal
public static final int WaitingForPath
protected int _velocity
protected int _state
protected double _boundingRadius
protected UnitControler _uc
protected PathPlace _pp
protected boolean _recomputing
protected UnitMediator _um
protected double _savedMovPoints
protected double _baseTurnIncrement
protected PathPlace _previousOne
Constructor Detail |
public MyUnit(SimEnvironment sime, PathPlace current, UnitMediator um, Owner owner, java.lang.String className)
Method Detail |
public PathPlace getCurrentPathPlace()
PathUser
getCurrentPathPlace
in interface PathUser
getCurrentPathPlace
in class SimulatedObject
public Owner getOwner()
public UnitControler getUnitControler()
public void move()
protected void updateStateId(PathPlace from, PathPlace to)
public void takeTurn()
SimObject
takeTurn
in interface SimObject
public boolean isCollision(PathPlace mp)
public void resolveNewMove(PathPlace m)
public void setVelocity(int value)
public int getVelocity()
public double getBoundingCircleRadius()
getBoundingCircleRadius
in interface SimObject
public void firePathComputed(PathPlaceSet path)
PathUser
firePathComputed
in interface PathUser
path
- A PathPlaceSet.public void setState(int i)
public int getX()
getX
in interface Drawable2DObject
public int getY()
Drawable2DObject
getY
in interface Drawable2DObject
public int getHeight()
Drawable2DObject
getHeight
in interface Drawable2DObject
getHeight
in class SimulatedObject
public int getWidth()
Drawable2DObject
getWidth
in interface Drawable2DObject
getWidth
in class SimulatedObject
public java.awt.Color getMiniMapColor()
Drawable2DObject
getMiniMapColor
in interface Drawable2DObject
public void stopUnit()
public void debug(java.lang.String msg, int lvl)
public java.lang.String getObjectType()
SimObject
getObjectType
in interface SimObject
public void stopObject()
SimObject
stopObject
in interface SimObject
stopObject
in class SimulatedObject
|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |