FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
RoutePatherSearch using A*. More...
#include <routepathersearch.h>
Public Types | |
enum | SearchStatus { search_status_failed, search_status_complete, search_status_incomplete } |
An enumeration of the different status the search can be in. More... | |
Public Member Functions | |
RoutePatherSearch (Route *route, const int32_t sessionId) | |
Constructor. More... | |
virtual | ~RoutePatherSearch () |
virtual void | updateSearch ()=0 |
Updates the search. More... | |
virtual void | calcPath ()=0 |
Calculates final path. More... | |
int32_t | getSessionId () const |
Retrieves the session id. More... | |
int32_t | getSearchStatus () const |
A small function which returns the current status of the search. More... | |
Route * | getRoute () |
Returns the associated route for this search. More... | |
Protected Member Functions | |
void | setSearchStatus (const SearchStatus status) |
Sets the current status of the search. More... | |
Protected Attributes | |
Route * | m_route |
Pointer to route. More... | |
bool | m_specialCost |
Indicates if the search should use special costs. More... | |
bool | m_multicell |
Indicates if the route is for a multi cell object. More... | |
bool | m_ignoreDynamicBlockers |
Indicates if dynamic blockers should be ignored. More... | |
std::vector< Cell * > | m_ignoredBlockers |
Blockers from a multi cell object which should be ignored. More... | |
Private Attributes | |
int32_t | m_sessionId |
An integer containing the session id for this search. More... | |
SearchStatus | m_status |
An enumeration of the searches current status. More... | |
RoutePatherSearch using A*.
Definition at line 43 of file routepathersearch.h.
An enumeration of the different status the search can be in.
Enumerator | |
---|---|
search_status_failed | |
search_status_complete | |
search_status_incomplete |
Definition at line 57 of file routepathersearch.h.
FIFE::RoutePatherSearch::RoutePatherSearch | ( | Route * | route, |
const int32_t | sessionId | ||
) |
Constructor.
route | A pointer to the route for which a path should be searched. |
sessionId | A integer containing the session id for this search. |
Definition at line 41 of file routepathersearch.cpp.
References FIFE::CellCache::getCell(), FIFE::Layer::getCellCache(), FIFE::Route::getCostId(), FIFE::Location::getLayer(), FIFE::Route::getOccupiedArea(), FIFE::Route::getStartNode(), FIFE::Route::isDynamicBlockerIgnored(), m_ignoredBlockers, m_ignoreDynamicBlockers, m_multicell, m_route, m_specialCost, FIFE::ROUTE_SEARCHING, and FIFE::Route::setRouteStatus().
|
virtual |
Definition at line 63 of file routepathersearch.cpp.
|
pure virtual |
Calculates final path.
If the search is successful then a path is created.
Implemented in FIFE::MultiLayerSearch, and FIFE::SingleLayerSearch.
Referenced by FIFE::RoutePather::solveRoute(), and FIFE::RoutePather::update().
Route * FIFE::RoutePatherSearch::getRoute | ( | ) |
Returns the associated route for this search.
Definition at line 74 of file routepathersearch.cpp.
References m_route.
Referenced by FIFE::RoutePather::update().
int32_t FIFE::RoutePatherSearch::getSearchStatus | ( | ) | const |
A small function which returns the current status of the search.
Definition at line 70 of file routepathersearch.cpp.
References m_status.
Referenced by FIFE::RoutePather::solveRoute(), FIFE::RoutePather::update(), and FIFE::MultiLayerSearch::updateSearch().
int32_t FIFE::RoutePatherSearch::getSessionId | ( | ) | const |
Retrieves the session id.
Definition at line 66 of file routepathersearch.cpp.
References m_sessionId.
Referenced by FIFE::RoutePather::update().
|
protected |
Sets the current status of the search.
status | The status to set. |
Definition at line 78 of file routepathersearch.cpp.
References m_status.
Referenced by FIFE::SingleLayerSearch::calcPath(), FIFE::MultiLayerSearch::calcPath(), FIFE::MultiLayerSearch::calcPathStep(), FIFE::MultiLayerSearch::MultiLayerSearch(), FIFE::SingleLayerSearch::updateSearch(), and FIFE::MultiLayerSearch::updateSearch().
|
pure virtual |
Updates the search.
Each update checks all neighbors of the last checked coordinate and selects the most favorable.
Implemented in FIFE::MultiLayerSearch, and FIFE::SingleLayerSearch.
Referenced by FIFE::RoutePather::solveRoute(), and FIFE::RoutePather::update().
|
protected |
Blockers from a multi cell object which should be ignored.
Definition at line 114 of file routepathersearch.h.
Referenced by RoutePatherSearch(), FIFE::SingleLayerSearch::updateSearch(), and FIFE::MultiLayerSearch::updateSearch().
|
protected |
Indicates if dynamic blockers should be ignored.
Definition at line 111 of file routepathersearch.h.
Referenced by RoutePatherSearch(), FIFE::SingleLayerSearch::updateSearch(), and FIFE::MultiLayerSearch::updateSearch().
|
protected |
Indicates if the route is for a multi cell object.
Definition at line 108 of file routepathersearch.h.
Referenced by RoutePatherSearch(), FIFE::SingleLayerSearch::updateSearch(), and FIFE::MultiLayerSearch::updateSearch().
|
protected |
Pointer to route.
Definition at line 102 of file routepathersearch.h.
Referenced by FIFE::SingleLayerSearch::calcPath(), FIFE::MultiLayerSearch::calcPath(), FIFE::MultiLayerSearch::calcPathStep(), getRoute(), FIFE::MultiLayerSearch::MultiLayerSearch(), RoutePatherSearch(), FIFE::SingleLayerSearch::updateSearch(), and FIFE::MultiLayerSearch::updateSearch().
|
private |
An integer containing the session id for this search.
Definition at line 118 of file routepathersearch.h.
Referenced by getSessionId().
|
protected |
Indicates if the search should use special costs.
Definition at line 105 of file routepathersearch.h.
Referenced by RoutePatherSearch(), FIFE::SingleLayerSearch::updateSearch(), and FIFE::MultiLayerSearch::updateSearch().
|
private |
An enumeration of the searches current status.
Definition at line 121 of file routepathersearch.h.
Referenced by getSearchStatus(), and setSearchStatus().