Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::vector<std::shared_ptr<App::Node>> AStar::findPath(std::vector<std::shared_ptr<App::Node>> nodes, std::shared_ptr<App::Node> start, std::shared_ptr<App::Node> end)
- {
- std::shared_ptr<NodeWrapper> current;
- current = std::make_shared<NodeWrapper>(nullptr, start, end);
- //jádro algoritmu, celé zakomentované
- //...
- std::vector<std::shared_ptr<NodeWrapper>> way = current->getWay();
- // hydrating path from node wrappers
- auto path = std::vector<std::shared_ptr<App::Node>>(way.size());
- for (size_t i = 0; i < way.size(); i++)
- {
- path[i] = way[i]->getNode();
- }
- return path;
- }
Advertisement
Add Comment
Please, Sign In to add comment