Prettied it up, comments, refactors
This commit is contained in:
46
aStar/node.h
46
aStar/node.h
@@ -1,26 +1,44 @@
|
||||
#pragma once
|
||||
#include <SFML/Graphics.hpp>
|
||||
#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_);
|
||||
|
||||
// XY position, hueristic value, cameFrom direction, parent, ref to pather
|
||||
node(sf::Vector2i position_, double hueristic_, int came_from_, node* parent_, Pather* pather_);
|
||||
node();
|
||||
~node();
|
||||
|
||||
sf::Vector2i xy;
|
||||
|
||||
|
||||
// Ugh, pointers, ugh c++
|
||||
// Populate the open_list with neighbors
|
||||
void getNewNeighbors();
|
||||
|
||||
// HAS THE ABILITY TO DELETE THE PARENT!!
|
||||
node* getParent();
|
||||
|
||||
sf::Vector2i getPosition();
|
||||
double getHueristic();
|
||||
int getCameFrom();
|
||||
|
||||
private:
|
||||
// Position of the node
|
||||
sf::Vector2i position;
|
||||
|
||||
// The parent of the node, previous one visited
|
||||
node* parent;
|
||||
int hueristic;
|
||||
int cameFrom;
|
||||
int closedList;
|
||||
|
||||
// How close it is to the destination
|
||||
double hueristic;
|
||||
|
||||
// What direction the parent was
|
||||
int came_from;
|
||||
|
||||
// Ref to pather
|
||||
Pather* pather;
|
||||
|
||||
void neighbors();
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user