Jamie Slowgrove - AI Assignment 1
Line of Sight & A* path-finding
 All Classes Namespaces Files Functions Variables
node.h
Go to the documentation of this file.
1 #pragma once
2 
7 class Node
8 {
9 private:
10  /*the index of the parent node*/
13  /*the index of the node*/
16  /*boolean values to if they are a specific node*/
17  bool startNode;
18  bool endNode;
19  /*is the node safe to walk on*/
20  bool safe;
21  /*the cost to move to the node*/
22  int cost;
23  /*the f score of the node*/
24  int fScore;
25  /*boolean values for if the node is on a list*/
26  bool listed;
27 public:
33  Node(int nodeXIndex, int nodeYIndex);
34 
38  ~Node();
39 
45  void setParentIndex(int parentNodeXIndex, int parentNodeYIndex);
46 
51  int getParentXIndex();
52 
57  int getParentYIndex();
58 
63  void setStartNode(bool startNode);
64 
69  bool getStartNode();
70 
75  void setEndNode(bool endNode);
76 
81  bool getEndNode();
82 
87  void setSafeNode(bool safe);
88 
93  bool getSafeNode();
94 
99  void setCostNode(int cost);
100 
105  int getCostNode();
106 
111  void setFScoreNode(int fScore);
112 
117  int getFScoreNode();
118 
123  int getXIndex();
124 
129  int getYIndex();
130 
135  void setListed(bool listed);
136 
141  bool getListed();
142 };
void setCostNode(int cost)
Definition: node.cpp:116
void setListed(bool listed)
Definition: node.cpp:170
~Node()
Definition: node.cpp:27
bool getSafeNode()
Definition: node.cpp:107
int fScore
Definition: node.h:24
int getFScoreNode()
Definition: node.cpp:143
int parentNodeYIndex
Definition: node.h:12
Creates a Node object Creates a Node object for use with path finding.
Definition: node.h:7
bool startNode
Definition: node.h:17
bool getListed()
Definition: node.cpp:179
int getXIndex()
Definition: node.cpp:152
int nodeXIndex
Definition: node.h:14
bool endNode
Definition: node.h:18
Node(int nodeXIndex, int nodeYIndex)
Definition: node.cpp:6
bool listed
Definition: node.h:26
int getParentXIndex()
Definition: node.cpp:44
void setParentIndex(int parentNodeXIndex, int parentNodeYIndex)
Definition: node.cpp:34
void setSafeNode(bool safe)
Definition: node.cpp:98
int getYIndex()
Definition: node.cpp:161
bool safe
Definition: node.h:20
int getCostNode()
Definition: node.cpp:125
bool getStartNode()
Definition: node.cpp:71
void setStartNode(bool startNode)
Definition: node.cpp:62
bool getEndNode()
Definition: node.cpp:89
int nodeYIndex
Definition: node.h:15
int getParentYIndex()
Definition: node.cpp:53
void setFScoreNode(int fScore)
Definition: node.cpp:134
int parentNodeXIndex
Definition: node.h:11
int cost
Definition: node.h:22
void setEndNode(bool endNode)
Definition: node.cpp:80