mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-28 19:21:04 +00:00
Store aStarSearch result to deque
This commit is contained in:
parent
9b3756f8bc
commit
2f424f6be2
apps/openmw/mwmechanics
@ -257,10 +257,9 @@ namespace MWMechanics
|
||||
* pathgrid points form (currently they are converted to world
|
||||
* coordinates). Essentially trading speed w/ memory.
|
||||
*/
|
||||
std::list<ESM::Pathgrid::Point> PathgridGraph::aStarSearch(const int start,
|
||||
const int goal) const
|
||||
std::deque<ESM::Pathgrid::Point> PathgridGraph::aStarSearch(const int start, const int goal) const
|
||||
{
|
||||
std::list<ESM::Pathgrid::Point> path;
|
||||
std::deque<ESM::Pathgrid::Point> path;
|
||||
if(!isPointConnected(start, goal))
|
||||
{
|
||||
return path; // there is no path, return an empty path
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef GAME_MWMECHANICS_PATHGRID_H
|
||||
#define GAME_MWMECHANICS_PATHGRID_H
|
||||
|
||||
#include <list>
|
||||
#include <deque>
|
||||
|
||||
#include <components/esm/loadpgrd.hpp>
|
||||
|
||||
@ -38,8 +38,8 @@ namespace MWMechanics
|
||||
// cells) coordinates
|
||||
//
|
||||
// NOTE: if start equals end an empty path is returned
|
||||
std::list<ESM::Pathgrid::Point> aStarSearch(const int start,
|
||||
const int end) const;
|
||||
std::deque<ESM::Pathgrid::Point> aStarSearch(const int start, const int end) const;
|
||||
|
||||
private:
|
||||
|
||||
const ESM::Cell *mCell;
|
||||
|
Loading…
x
Reference in New Issue
Block a user