Prettied it up, comments, refactors

This commit is contained in:
2015-08-22 17:43:38 -07:00
parent 8fc8db2d78
commit ee6ea3442d
12 changed files with 258 additions and 237 deletions

View File

@@ -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:
};
};