FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
#include <ipather.h>
Public Member Functions | |
virtual | ~IPather () |
virtual Route * | createRoute (const Location &start, const Location &end, bool immediate=false, const std::string &cost_id="")=0 |
Creates a route between the start and end location that needs be solved. More... | |
virtual bool | solveRoute (Route *route, int32_t priority=MEDIUM_PRIORITY, bool immediate=false)=0 |
Solves the route to create a path. More... | |
virtual bool | followRoute (const Location ¤t, Route *route, double speed, Location &nextLocation)=0 |
Follows the path of the route. More... | |
virtual void | update ()=0 |
Updates the pather (should it need updating). More... | |
virtual bool | cancelSession (const int32_t sessionId)=0 |
Cancels a given session. More... | |
virtual void | setMaxTicks (int32_t ticks)=0 |
Sets maximal ticks (update steps) to solve routes. More... | |
virtual int32_t | getMaxTicks ()=0 |
Returns maximal ticks (update steps) to solve routes. More... | |
virtual std::string | getName () const =0 |
Gets the name of this pather. More... | |
|
inlinevirtual |
Definition at line 51 of file ipather.h.
References cancelSession(), createRoute(), followRoute(), getMaxTicks(), getName(), FIFE::MEDIUM_PRIORITY, setMaxTicks(), solveRoute(), and update().
|
pure virtual |
Cancels a given session.
This function is called when (for instance) the user changes their mind about a destination while the agent is already moving, the old session needs to be cancelled and a new one created.
sessionId | The id of the session to cancel. |
Implemented in FIFE::RoutePather.
Referenced by FIFE::ActionInfo::~ActionInfo(), and ~IPather().
|
pure virtual |
Creates a route between the start and end location that needs be solved.
start | A const reference to the start location. |
end | A const reference to the target location. |
immediate | A optional boolean, if true the route bypass the max. ticks limit and solves the path immediately, otherwise false. |
cost_id | A const reference to the string that holds the cost identifier. You can use it optional then this cost id is used instead of the default cost. |
Implemented in FIFE::RoutePather.
Referenced by ~IPather().
|
pure virtual |
Follows the path of the route.
current | A const reference to the current location. |
route | A pointer to the route which should be followed. |
speed | A double which holds the speed. |
nextLocation | A reference to the next location returned by the pather. |
Implemented in FIFE::RoutePather.
Referenced by FIFE::Instance::processMovement(), and ~IPather().
|
pure virtual |
Returns maximal ticks (update steps) to solve routes.
Implemented in FIFE::RoutePather.
Referenced by ~IPather().
|
pure virtual |
Gets the name of this pather.
Implemented in FIFE::RoutePather.
Referenced by ~IPather().
|
pure virtual |
Sets maximal ticks (update steps) to solve routes.
ticks | A integer which holds the steps. default is 1000 |
Implemented in FIFE::RoutePather.
Referenced by ~IPather().
|
pure virtual |
Solves the route to create a path.
route | A pointer to the route which should be solved. |
priority | The priority to assign to search (high are pushed to the front of the queue). |
immediate | A optional boolean, if true the route bypass the max. ticks limit and solves the path immediately, otherwise false. |
Implemented in FIFE::RoutePather.
Referenced by FIFE::Instance::move(), FIFE::Instance::processMovement(), and ~IPather().
|
pure virtual |
Updates the pather (should it need updating).
The update method is called by the model. Pathfinders which require per loop updating (in the case of pathfinders which implement A* for instance) should use this method as an oppurtunity to update the search. Generally the method should be constrained to a maximum amount of search updating to prevent this method from stalling the application.
Implemented in FIFE::RoutePather.
Referenced by ~IPather().