initial commit
[COMP345---Clone.git] / Node.h
blob06dfaf812957c568c3a61560bb8a8e456bf07eb3
1 #pragma once
3 //! @file Node.h
4 //! @brief Class representing a cell in the map.
5 //!
7 //! Class representing a cell in the map
9 //! Will most likely change in a
10 //! future version. This class was implemented in order to facilitate
11 //! the pathfinding algorithm in the findValidPath function in the Map class.
12 class Node
14 public:
15 Node();
16 Node(int newId, int newRow, int newColumn);
17 Node(int newId, int newRow, int newColumn, int newHeuristic, bool newTraversable);
19 //! Sets the Node's heuristic value.
20 //! @param newHeuristic The new heuristic value to set.
21 void setHeuristic(int newHeuristic);
23 //! Sets the Node's id.
24 //! @param newId The new id value to set.
25 void setId(int newId);
27 //! Sets the Node's row.
28 //! @param newRow The new row value to set.
29 void setRow(int newRow);
31 //! Sets the Nodes's column.
32 //! @param newColumn The new column value to set.
33 void setColumn(int newColumn);
35 //! Sets the Node's bool traversable.
36 //! @param newTraversable The new traversable value to set.
37 void setTraversable(bool newTraversable);
39 //! @return The Node's heuristic.
40 int getHeuristic();
42 //! @return The Node's id.
43 int getId();
45 //! @return The Node's row.
46 int getRow();
48 //! @return The Node's column.
49 int getColumn();
51 //! @return The Node's traversable field.
52 bool getTraversable();
54 private:
55 //! The heuristic is the number of cells the Node is away from the end cell. If it is right next
56 //! to the end cell, the value will be 1.
57 int heuristic;
59 //! The id of a Node is its linear position in the map. In other words, it's the x-th cell the map. 0 based.
60 int id;
62 //! The row the Node is located on.
63 int row;
65 //! The column the node is located on.
66 int column;
68 //! bool indicating whether or not the Node can be traversed.
69 bool traversable;