22 #ifndef FIFE_PATHFINDER_ROUTEPATHER 23 #define FIFE_PATHFINDER_ROUTEPATHER 42 class RoutePatherSearch;
117 typedef std::list<Location>
Path;
int32_t m_nextFreeSessionId
The next free session id.
bool locationsEqual(const Location &a, const Location &b)
Are two locations equivalent from the perspective of pathing (same layer coordinates and layer)...
PriorityQueue< RoutePatherSearch *, int32_t > SessionQueue
Holds the searches and their priority.
bool solveRoute(Route *route, int32_t priority=MEDIUM_PRIORITY, bool immediate=false)
Solves the route to create a path.
std::list< int32_t > SessionList
Holds the sessions.
std::list< Location > Path
A path is a list with locations. Each location holds the coordinate for one cell. ...
bool sessionIdValid(const int32_t sessionId)
Determines if the given session Id is valid.
bool invalidateSessionId(const int32_t sessionId)
Removes a session id from the session map.
bool followRoute(const Location ¤t, Route *route, double speed, Location &nextLocation)
Follows the path of the route.
int32_t makeSessionId()
Makes a new session id.
int32_t m_maxTicks
The maximum number of ticks allowed.
std::string getName() const
Returns name of the pathfinder.
Route * createRoute(const Location &start, const Location &end, bool immediate=false, const std::string &costId="")
Creates a route between the start and end location that needs be solved.
bool cancelSession(const int32_t sessionId)
Cancels a session.
void addSessionId(const int32_t sessionId)
Adds a session id to the session map.
SessionList m_registeredSessionIds
A list of session ids that have been registered.
RoutePather()
Constructor.
int32_t getMaxTicks()
Returns maximal ticks (update steps) to solve routes.
SessionQueue m_sessions
A map of currently running sessions (searches).
void update()
Updates the route pather.
void setMaxTicks(int32_t ticks)
Sets maximal ticks (update steps) to solve routes.