|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

public interface IUT2004Navigation
Facade for navigation in UT2004. Method navigate() can be called both synchronously and asynchronously.
Uses IUT2004PathExecutor, FloydWarshallMap, IUT2004RunStraight and IUT2004GetBackToNavGraph
to handle all possible navigation cases.
| Method Summary | |
|---|---|
void |
addStrongNavigationListener(cz.cuni.amis.utils.flag.FlagListener<NavigationState> listener)
Use this to register listeners to various states the navigation - stuck, target reached, etc. |
IUT2004GetBackToNavGraph |
getBackToNavGraph()
Returns underlying IUT2004GetBackToNavGraph object that is being used by this IUT2004Navigation. |
ILocated |
getContinueTo()
Returns where the bot will continue to, for more info see setContinueTo(ILocated). |
List<ILocated> |
getCurrentPathCopy()
Returns COPY of current path in list. |
List<ILocated> |
getCurrentPathDirect()
Returns current path as in IPathFuture object that is used by ut2004pathExecutor to navigate. |
ILocated |
getCurrentTarget()
Current POINT where the navigation is trying to get to. |
Item |
getCurrentTargetItem()
If navigation is trying to get to some item, otherwise returns null. |
NavPoint |
getCurrentTargetNavPoint()
If navigation is trying to get to some navpoint, otherwise returns null. |
Player |
getCurrentTargetPlayer()
If navigation is trying to get to some player, otherwise returns null. |
ILocated |
getLastTarget()
Returns previous location we tried to get to (i.e., what was UT2004Navigation.getCurrentTarget() before
another UT2004Navigation.navigate(ILocated) or UT2004Navigation.navigate(Player) was called. |
Item |
getLastTargetItem()
If previous target was an item, returns non-null Item we previously tried to get to. |
Player |
getLastTargetPlayer()
If previous target was a player, returns non-null player we previously tried to get to (i.e., what was UT2004Navigation.getCurrentTargetPlayer() before
another UT2004Navigation.navigate(ILocated) or UT2004Navigation.navigate(Player) was called. |
Logger |
getLog()
Returns logger used by the object. |
NavPoint |
getNearestNavPoint(ILocated location)
Returns nearest navigation point to input location. |
IUT2004PathExecutor<ILocated> |
getPathExecutor()
Returns underlying IUT2004PathExecutor object that is being used by this IUT2004Navigation. |
double |
getRemainingDistance()
Returns how far is our target (path-distance == real-distance). |
IUT2004RunStraight |
getRunStraight()
Returns underlying IUT2004RunStraight object that is being used by this IUT2004Navigation. |
cz.cuni.amis.utils.flag.Flag<NavigationState> |
getState()
Returns an immutable flag with the current state of the navigation. |
boolean |
isNavigating()
True if navigating, e.g., trying to get somewhere using either IUT2004PathExecutor, IUT2004GetBackToNavGraph or IUT2004RunStraight. |
boolean |
isNavigatingToItem()
Whether we're currently navigating to item (final target). |
boolean |
isNavigatingToNavPoint()
Whether we're currently navigating to navpoint (final target). |
boolean |
isNavigatingToPlayer()
Whether we're currently navigating to player (final target). |
boolean |
isPathExecuting()
Whether UT2004Navigation is currently using IUT2004PathExecutor to follow the path. |
boolean |
isRunningStraight()
Whether UT2004Navigation is currently using UT2004Navigation.runStraight to get to player by running straight to it/him/her. |
boolean |
isTryingToGetBackToNav()
Whether UT2004Navigation is currently trying to get back to nav using IUT2004GetBackToNavGraph. |
void |
navigate(ILocated target)
This method can be called periodically or asynchronously. |
void |
navigate(IPathFuture<ILocated> pathHandle)
Let the bot to follow this path. |
void |
navigate(Player player)
This method can be called periodically or asynchronously. |
void |
removeStrongNavigationListener(cz.cuni.amis.utils.flag.FlagListener<NavigationState> listener)
Removes path state listener. |
void |
setContinueTo(ILocated target)
When the bot is about to reach its target, it will prolong his path to continue to 'target'. |
void |
setFocus(ILocated located)
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 |
stopNavigation()
Stops navigation and resets the class. |
| Method Detail |
|---|
void addStrongNavigationListener(cz.cuni.amis.utils.flag.FlagListener<NavigationState> listener)
NavigationState.
listener - void removeStrongNavigationListener(cz.cuni.amis.utils.flag.FlagListener<NavigationState> listener)
listener - IUT2004PathExecutor<ILocated> getPathExecutor()
IUT2004PathExecutor object that is being used by this IUT2004Navigation.
IUT2004GetBackToNavGraph getBackToNavGraph()
IUT2004GetBackToNavGraph object that is being used by this IUT2004Navigation.
IUT2004RunStraight getRunStraight()
IUT2004RunStraight object that is being used by this IUT2004Navigation.
boolean isNavigating()
IUT2004PathExecutor, IUT2004GetBackToNavGraph or IUT2004RunStraight.
boolean isNavigatingToNavPoint()
boolean isNavigatingToItem()
boolean isNavigatingToPlayer()
boolean isTryingToGetBackToNav()
UT2004Navigation is currently trying to get back to nav using IUT2004GetBackToNavGraph.
boolean isPathExecuting()
UT2004Navigation is currently using IUT2004PathExecutor to follow the path.
boolean isRunningStraight()
UT2004Navigation is currently using UT2004Navigation.runStraight to get to player by running straight to it/him/her.
void setFocus(ILocated located)
located - void stopNavigation()
void navigate(ILocated target)
target - target locationvoid navigate(Player player)
location - target locationvoid navigate(IPathFuture<ILocated> pathHandle)
pathHandle - void setContinueTo(ILocated target)
navigate(Player).
WARNING: continueTo is reset when bot stop navigating / stuck, etc.
WARNING: continueTo is also "nullified" when the bot actually prolongs its path to reach the 'target'.
target - cannot be PlayerILocated getContinueTo()
setContinueTo(ILocated).
WARNING: continueTo is reset when bot stop navigating / stuck, etc.
WARNING: continueTo is also "nullified" when the bot actually prolongs its path to reach the 'target'.
NavPoint getNearestNavPoint(ILocated location)
location -
List<ILocated> getCurrentPathCopy()
List<ILocated> getCurrentPathDirect()
ILocated getCurrentTarget()
Player getCurrentTargetPlayer()
Item getCurrentTargetItem()
NavPoint getCurrentTargetNavPoint()
ILocated getLastTarget()
UT2004Navigation.getCurrentTarget() before
another UT2004Navigation.navigate(ILocated) or UT2004Navigation.navigate(Player) was called.
Player getLastTargetPlayer()
UT2004Navigation.getCurrentTargetPlayer() before
another UT2004Navigation.navigate(ILocated) or UT2004Navigation.navigate(Player) was called.
Item getLastTargetItem()
Item we previously tried to get to.
(i.e., what was UT2004Navigation.getCurrentTargetItem() before
another UT2004Navigation.navigate(ILocated) or UT2004Navigation.navigate(Player) was called.
cz.cuni.amis.utils.flag.Flag<NavigationState> getState()
double getRemainingDistance()
Logger getLog()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||