Store aStarSearch result to deque

pull/541/head
elsid 6 years ago
parent 9b3756f8bc
commit 2f424f6be2
No known key found for this signature in database
GPG Key ID: B845CB9FEE18AB40

@ -257,10 +257,9 @@ namespace MWMechanics
* pathgrid points form (currently they are converted to world * pathgrid points form (currently they are converted to world
* coordinates). Essentially trading speed w/ memory. * coordinates). Essentially trading speed w/ memory.
*/ */
std::list<ESM::Pathgrid::Point> PathgridGraph::aStarSearch(const int start, std::deque<ESM::Pathgrid::Point> PathgridGraph::aStarSearch(const int start, const int goal) const
const int goal) const
{ {
std::list<ESM::Pathgrid::Point> path; std::deque<ESM::Pathgrid::Point> path;
if(!isPointConnected(start, goal)) if(!isPointConnected(start, goal))
{ {
return path; // there is no path, return an empty path return path; // there is no path, return an empty path

@ -1,7 +1,7 @@
#ifndef GAME_MWMECHANICS_PATHGRID_H #ifndef GAME_MWMECHANICS_PATHGRID_H
#define GAME_MWMECHANICS_PATHGRID_H #define GAME_MWMECHANICS_PATHGRID_H
#include <list> #include <deque>
#include <components/esm/loadpgrd.hpp> #include <components/esm/loadpgrd.hpp>
@ -38,8 +38,8 @@ namespace MWMechanics
// cells) coordinates // cells) coordinates
// //
// NOTE: if start equals end an empty path is returned // NOTE: if start equals end an empty path is returned
std::list<ESM::Pathgrid::Point> aStarSearch(const int start, std::deque<ESM::Pathgrid::Point> aStarSearch(const int start, const int end) const;
const int end) const;
private: private:
const ESM::Cell *mCell; const ESM::Cell *mCell;

Loading…
Cancel
Save