aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorymherklotz <ymherklotz@gmail.com>2016-12-11 15:42:21 +0000
committerymherklotz <ymherklotz@gmail.com>2016-12-11 15:42:21 +0000
commit45912bc25564150c985de69c8c35c875b3141361 (patch)
treeb124abe3b5c8847463be2db87e4f96203fa582ce /include
parent5e28a82b5e8638392d5527dbce8aa44008280b04 (diff)
downloadA-star-algorithm-45912bc25564150c985de69c8c35c875b3141361.tar.gz
A-star-algorithm-45912bc25564150c985de69c8c35c875b3141361.zip
adding support for 8 corners
Diffstat (limited to 'include')
-rw-r--r--include/astar.hpp4
-rw-r--r--include/node.hpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/include/astar.hpp b/include/astar.hpp
index 30e9d65..321431c 100644
--- a/include/astar.hpp
+++ b/include/astar.hpp
@@ -9,7 +9,7 @@
// defines the number of nodes one can go to
// we don't need this as we will have the queues
-#define NEIGHBOUR_NUM 4
+#define NEIGHBOUR_NUM 8
// TODO add constructors and functions to calculate heuristics etc..
class AStar {
@@ -29,6 +29,8 @@ private:
int graph_height;
int path_length;
+ int count;
+
Node start_node, end_node;
bool start_algorithm();
diff --git a/include/node.hpp b/include/node.hpp
index f126fc4..5e29d81 100644
--- a/include/node.hpp
+++ b/include/node.hpp
@@ -31,7 +31,7 @@ private:
// path length to get to that node.
int g_score;
// heuristic length to destination.
- int h_score;
+ double h_score;
// the x and y coordinates of the node in the grid
int x, y;