Classes | Public Member Functions | Protected Member Functions | List of all members
ime::IPathFinderStrategy Class Referenceabstract

Interface for grid path finder algorithms. More...

#include <IPathFinderStrategy.h>

Inheritance diagram for ime::IPathFinderStrategy:
ime::BFS ime::DFS

Classes

struct  Node
 A node in the grid. More...
 

Public Member Functions

virtual std::stack< IndexfindPath (const Grid2D &grid, const Index &sourceNode, const Index &source)=0
 Find a path from a source tile to a target tile in a grid. More...
 
virtual std::string getType () const =0
 Get the type of path finding algorithm. More...
 
virtual ~IPathFinderStrategy ()=default
 Destructor. More...
 

Protected Member Functions

std::stack< Indexbacktrack (const std::vector< Node > &exploredNodes, const Index &target)
 Generate path from the source to the target. More...
 

Detailed Description

Interface for grid path finder algorithms.

Definition at line 39 of file IPathFinderStrategy.h.

Constructor & Destructor Documentation

◆ ~IPathFinderStrategy()

virtual ime::IPathFinderStrategy::~IPathFinderStrategy ( )
virtualdefault

Destructor.

Member Function Documentation

◆ backtrack()

std::stack< Index > ime::IPathFinderStrategy::backtrack ( const std::vector< Node > &  exploredNodes,
const Index target 
)
protected

Generate path from the source to the target.

Parameters
exploredNodesNodes explored after algorithm termination
targetThe index of the target tile in the grid
Returns
The path from the source to the target tile if found, otherwise an empty path

◆ findPath()

virtual std::stack< Index > ime::IPathFinderStrategy::findPath ( const Grid2D grid,
const Index sourceNode,
const Index source 
)
pure virtual

Find a path from a source tile to a target tile in a grid.

Parameters
gridGrid to find path in
sourceNodeThe starting tile
sourceThe destination tile
Returns
The path from the source to the destination if the destination is reachable from the source, otherwise an empty path

Implemented in ime::BFS, and ime::DFS.

◆ getType()

virtual std::string ime::IPathFinderStrategy::getType ( ) const
pure virtual

Get the type of path finding algorithm.

Returns
The type of the path finding algorithm

Implemented in ime::BFS, and ime::DFS.


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