|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PATH_ELEMENT
- public interface IUT2004PathNavigator<PATH_ELEMENT extends ILocated>
Navigator purpose is to actually move the bot through the UT2004 environment - if you did not read IPathExecutor
and UT2004PathExecutor
documentation, do it now. If you did, read on.
The IUT2004PathNavigator
navigator is the easiest-to-implement piece of UT2004PathExecutor
in
terms that it has only two methods to implement. On the other hand - it is acrually very hard to navigate the bot
through UT2004 environment. But! If you need to actually change the way how bot is running inside the UT2004,
implementing own IUT2004PathNavigator
is the best thing to do (you should probably start
by copy-pasting the code from UT2004PathExecutorNavigator
into your new class and experiment with it a bit).
This navigator interface is actually used by UT2004PathExecutor
that covers the tricky part when and how
to call its methods IUT2004PathNavigator#navigate()
and reset()
.
Method Summary | |
---|---|
NavPointNeighbourLink |
getCurrentLink()
Returns current link the bot is following (if such link exist... may return null). |
Logger |
getLog()
|
void |
navigate(ILocated focus)
This method is regularly called by UT2004PathExecutor to continue the navigation of the bot
inside the UT2004. |
void |
newPath(List<PATH_ELEMENT> path)
UT2004PathExecutor reports that new path has been received and the IUT2004PathNavigator#navigate()
is about to be called in near future. |
void |
pathExtended(List<PATH_ELEMENT> path,
int currentPathIndex)
Path has been prolonged ... some elements (already passed) has been removed, some added. |
void |
reset()
UT2004PathExecutor reports that execution of current path has been terminated - clean up your internal data
structure and prepare to navigate the bot along the new path in the future. |
void |
setBot(UT2004Bot bot)
Sets the UT2004Bot instance that the navigator should navigate. |
void |
setExecutor(IUT2004PathExecutorHelper<PATH_ELEMENT> owner)
Sets the IPathExecutorHelper who is using the navigator, i.e., are calling its
IUT2004PathNavigator#navigate(Self) and reset()
methods. |
Method Detail |
---|
void setBot(UT2004Bot bot)
UT2004Bot
instance that the navigator should navigate. Use its AbstractEmbodiedAgent.getAct()
to pass commands to the bot.
bot
- void setExecutor(IUT2004PathExecutorHelper<PATH_ELEMENT> owner)
IPathExecutorHelper
who is using the navigator, i.e., are calling its
IUT2004PathNavigator#navigate(Self)
and reset()
methods.
Used by IPathExecutorHelper
implementation to inject its instance into the navigator,
so the navigator may call methods such as IPathExecutorHelper.checkStuckDetectors()
,
IPathExecutorHelper.switchToAnotherPathElement(int)
, IPathExecutorHelper.stuck()
and IPathExecutorHelper.targetReached()
.
owner
- void navigate(ILocated focus)
UT2004PathExecutor
to continue the navigation of the bot
inside the UT2004.
focus
- where the bot should have its focusNavPointNeighbourLink getCurrentLink()
void reset()
UT2004PathExecutor
reports that execution of current path has been terminated - clean up your internal data
structure and prepare to navigate the bot along the new path in the future.
void newPath(List<PATH_ELEMENT> path)
UT2004PathExecutor
reports that new path has been received and the IUT2004PathNavigator#navigate()
is about to be called in near future. The new path is passed as a parameter.
path
- void pathExtended(List<PATH_ELEMENT> path, int currentPathIndex)
path
- Logger getLog()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |