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.
44 lines
786 B
44 lines
786 B
9 years ago
|
#pragma once
|
||
9 years ago
|
#include <map>
|
||
9 years ago
|
#include "App.h"
|
||
9 years ago
|
#include <unordered_map>
|
||
|
|
||
|
class Pather;
|
||
9 years ago
|
|
||
|
class node {
|
||
|
public:
|
||
9 years ago
|
|
||
|
// XY position, hueristic value, cameFrom direction, parent, ref to pather
|
||
|
node(sf::Vector2i position_, double hueristic_, int came_from_, node* parent_, Pather* pather_);
|
||
9 years ago
|
node();
|
||
|
~node();
|
||
|
|
||
9 years ago
|
|
||
9 years ago
|
|
||
9 years ago
|
// Populate the open_list with neighbors
|
||
|
void getNewNeighbors();
|
||
|
|
||
|
// HAS THE ABILITY TO DELETE THE PARENT!!
|
||
|
node* getParent();
|
||
|
|
||
|
sf::Vector2i getPosition();
|
||
|
double getHueristic();
|
||
|
int getCameFrom();
|
||
9 years ago
|
|
||
|
private:
|
||
9 years ago
|
// Position of the node
|
||
|
sf::Vector2i position;
|
||
|
|
||
|
// The parent of the node, previous one visited
|
||
|
node* parent;
|
||
9 years ago
|
|
||
9 years ago
|
// How close it is to the destination
|
||
|
double hueristic;
|
||
9 years ago
|
|
||
9 years ago
|
// What direction the parent was
|
||
|
int came_from;
|
||
|
|
||
|
// Ref to pather
|
||
|
Pather* pather;
|
||
9 years ago
|
|
||
9 years ago
|
};
|