You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
877 B

9 years ago
#pragma once
#include <map>
#include "App.h"
#include <unordered_map>
class Pather;
class node {
public:
node(sf::Vector2i XY, int h, int cF, int cL, node* p, Pather* pather_);
node();
~node();
sf::Vector2i xy;
// Ugh, pointers, ugh c++
node* parent;
int hueristic;
int cameFrom;
int closedList;
Pather* pather;
void neighbors();
private:
};
class Pather {
public:
Pather(Map* map_);
~Pather();
Map* map;
std::unordered_map<node*, int> openList;
std::unordered_map<node*, int> closedList;
int visitedMap[App::WINDOW_HEIGHT][App::WINDOW_WIDTH];
9 years ago
std::deque<int> pathTo(sf::Vector2i start, sf::Vector2i end);
std::deque<int> loop();
std::deque<int> returnPath();
9 years ago
sf::Vector2i getEndNodePosition();
node* start_node;
node* active_node;
bool no_path = false;
bool early_exit;
private:
9 years ago
std::deque<int> path_list;
9 years ago
node* end_node;
};