mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-31 10:20:13 +00:00
Store aStarSearch result to deque
This commit is contained in:
parent
9b3756f8bc
commit
2f424f6be2
@ -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…
x
Reference in New Issue
Block a user