public class UT2004RunStraight extends Object implements IUT2004RunStraight
UT2004TimeStuckDetector
, UT2004PositionStuckDetector
and UT2004DistanceStuckDetector
.Modifier and Type | Field and Description |
---|---|
static double |
AT_NAVPOINT |
static double |
AT_PLAYER |
protected UT2004Bot |
bot |
static int |
CLOSE_ENOUGH |
protected ILocated |
currentTarget |
protected IWorldEventListener<EndMessage> |
endListener |
protected boolean |
executing |
protected boolean |
failed |
protected ILocated |
focus |
protected AgentInfo |
info |
protected Location |
initialLocation |
protected ILocated |
lastTarget |
protected LogCategory |
log |
static double |
MAX_ANGLE |
protected IUT2004PathRunner |
runner |
protected List<IStuckDetector> |
stuckDetectors |
protected boolean |
success |
Constructor and Description |
---|
UT2004RunStraight(UT2004Bot bot,
AgentInfo info,
AdvancedLocomotion move) |
Modifier and Type | Method and Description |
---|---|
void |
addStuckDetector(IStuckDetector stuckDetector)
Adds another stuck detector to be used for stuck detection :)
|
void |
clearStuckDetectors()
Removes ALL stuck detectors.
|
ILocated |
getCurrentTarget()
Get current target of the straight-run.
|
ILocated |
getLastTarget()
Get previous target of the straight-run.
|
boolean |
isExecuting()
Whether the object is executing the running.
|
boolean |
isFailed()
Whether our run has failed.
|
boolean |
isSuccess()
Whether our run has succeeded (once we get to our target, this returns true).
|
void |
removeStuckDetector(IStuckDetector stuckDetector)
Removes stuck detector.
|
protected void |
reset() |
protected void |
runStraight() |
void |
runStraight(ILocated target)
Run along straight-line to some target.
|
void |
setFocus(ILocated focus)
Sets focus of the bot when navigating (when using this object to run to some location target)!
To reset focus call this method with null parameter.
|
void |
stop(boolean stopMovement)
Stop the running.
|
protected void |
stuck() |
protected void |
success() |
public static final int CLOSE_ENOUGH
public static final double AT_PLAYER
public static final double AT_NAVPOINT
public static final double MAX_ANGLE
protected UT2004Bot bot
protected AgentInfo info
protected IUT2004PathRunner runner
protected boolean executing
protected LogCategory log
protected IWorldEventListener<EndMessage> endListener
protected List<IStuckDetector> stuckDetectors
protected Location initialLocation
protected ILocated currentTarget
protected boolean success
protected boolean failed
protected ILocated lastTarget
protected ILocated focus
public UT2004RunStraight(UT2004Bot bot, AgentInfo info, AdvancedLocomotion move)
public void addStuckDetector(IStuckDetector stuckDetector)
IUT2004RunStraight
addStuckDetector
in interface IUT2004RunStraight
public void removeStuckDetector(IStuckDetector stuckDetector)
IUT2004RunStraight
removeStuckDetector
in interface IUT2004RunStraight
public void clearStuckDetectors()
IUT2004RunStraight
clearStuckDetectors
in interface IUT2004RunStraight
public boolean isExecuting()
IUT2004RunStraight
isExecuting
in interface IUT2004RunStraight
public boolean isSuccess()
IUT2004RunStraight
isSuccess
in interface IUT2004RunStraight
public boolean isFailed()
IUT2004RunStraight
isFailed
in interface IUT2004RunStraight
public ILocated getLastTarget()
IUT2004RunStraight
getLastTarget
in interface IUT2004RunStraight
public ILocated getCurrentTarget()
IUT2004RunStraight
getCurrentTarget
in interface IUT2004RunStraight
public void setFocus(ILocated focus)
IUT2004RunStraight
setFocus
in interface IUT2004RunStraight
public void runStraight(ILocated target)
IUT2004RunStraight
runStraight
in interface IUT2004RunStraight
public void stop(boolean stopMovement)
IUT2004RunStraight
stop
in interface IUT2004RunStraight
protected void reset()
protected void runStraight()
protected void success()
protected void stuck()
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.