FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::RoutePatherSearch Class Referenceabstract

RoutePatherSearch using A*. More...

#include <routepathersearch.h>

+ Inheritance diagram for FIFE::RoutePatherSearch:
+ Collaboration diagram for FIFE::RoutePatherSearch:

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...
 
RoutegetRoute ()
 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

Routem_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...
 

Detailed Description

RoutePatherSearch using A*.

Definition at line 43 of file routepathersearch.h.

Member Enumeration Documentation

◆ SearchStatus

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.

Constructor & Destructor Documentation

◆ RoutePatherSearch()

FIFE::RoutePatherSearch::RoutePatherSearch ( Route route,
const int32_t  sessionId 
)

◆ ~RoutePatherSearch()

FIFE::RoutePatherSearch::~RoutePatherSearch ( )
virtual

Definition at line 63 of file routepathersearch.cpp.

Member Function Documentation

◆ calcPath()

virtual void FIFE::RoutePatherSearch::calcPath ( )
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().

+ Here is the caller graph for this function:

◆ getRoute()

Route * FIFE::RoutePatherSearch::getRoute ( )

Returns the associated route for this search.

Returns
A pointer to the route.

Definition at line 74 of file routepathersearch.cpp.

References m_route.

Referenced by FIFE::RoutePather::update().

+ Here is the caller graph for this function:

◆ getSearchStatus()

int32_t FIFE::RoutePatherSearch::getSearchStatus ( ) const

A small function which returns the current status of the search.

Returns
An integer value representing the status, which is enumerated by this class.

Definition at line 70 of file routepathersearch.cpp.

References m_status.

Referenced by FIFE::RoutePather::solveRoute(), FIFE::RoutePather::update(), and FIFE::MultiLayerSearch::updateSearch().

+ Here is the caller graph for this function:

◆ getSessionId()

int32_t FIFE::RoutePatherSearch::getSessionId ( ) const

Retrieves the session id.

Returns
The searches session id in the pather.

Definition at line 66 of file routepathersearch.cpp.

References m_sessionId.

Referenced by FIFE::RoutePather::update().

+ Here is the caller graph for this function:

◆ setSearchStatus()

void FIFE::RoutePatherSearch::setSearchStatus ( const SearchStatus  status)
protected

Sets the current status of the search.

Parameters
statusThe status to set.
See also
SearchStatus

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().

+ Here is the caller graph for this function:

◆ updateSearch()

virtual void FIFE::RoutePatherSearch::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().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_ignoredBlockers

std::vector<Cell*> FIFE::RoutePatherSearch::m_ignoredBlockers
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().

◆ m_ignoreDynamicBlockers

bool FIFE::RoutePatherSearch::m_ignoreDynamicBlockers
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().

◆ m_multicell

bool FIFE::RoutePatherSearch::m_multicell
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().

◆ m_route

◆ m_sessionId

int32_t FIFE::RoutePatherSearch::m_sessionId
private

An integer containing the session id for this search.

Definition at line 118 of file routepathersearch.h.

Referenced by getSessionId().

◆ m_specialCost

bool FIFE::RoutePatherSearch::m_specialCost
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().

◆ m_status

SearchStatus FIFE::RoutePatherSearch::m_status
private

An enumeration of the searches current status.

Definition at line 121 of file routepathersearch.h.

Referenced by getSearchStatus(), and setSearchStatus().


The documentation for this class was generated from the following files: