etrobocon2018 feat.KatLab  770af34cce41ae9c30c41303275e1add2daae0c3 (with uncommitted changes)
 全て クラス 名前空間 ファイル 関数 変数 列挙型 列挙値 フレンド マクロ定義 ページ
Node.cpp
[詳解]
1 #include "Node.h"
2 
3 void Node::setNeighbors(std::vector<Node*>* nodes)
4 {
5  neighbors = nodes;
6 }
7 
8 std::vector<Node*>* Node::getNeighbors()
9 {
10  return neighbors;
11 }
12 
13 void Node::setNodeID(std::int8_t nodeNumber)
14 {
15  nodeID = nodeNumber;
16 }
17 
18 std::int8_t Node::getNodeID()
19 {
20  return nodeID;
21 }
22 
23 void Node::setHasBlock(bool exists)
24 {
25  blockExists = exists;
26 }
27 
29 {
30  return blockExists;
31 }
32 
33 void Node::setPosition(std::int8_t x, std::int8_t y)
34 {
35  position.x = x;
36  position.y = y;
37 }
38 
39 std::int8_t Node::getPositionX()
40 {
41  return position.x;
42 }
43 
44 std::int8_t Node::getPositionY()
45 {
46  return position.y;
47 }
48 
50 {
51  parentNode = parent;
52 }
53 
55 {
56  return parentNode;
57 }
58 
59 void Node::setScore(std::int32_t score_)
60 {
61  score = score_;
62 }
63 
64 std::int32_t Node::getScore()
65 {
66  return score;
67 }
68 
69 void Node::setRealCost(std::int32_t cost)
70 {
71  realCost = cost;
72 }
73 
74 std::int32_t Node::getRealCost()
75 {
76  return realCost;
77 }
78 
79 void Node::setBeClosed(bool closed_)
80 {
81  closed = closed_;
82 }
83 
85 {
86  return closed;
87 }
void setPosition(std::int8_t x, std::int8_t y)
Definition: Node.cpp:33
void setNodeID(std::int8_t nodeNumber)
Definition: Node.cpp:13
std::int8_t getPositionX()
Definition: Node.cpp:39
Node * getParentNode()
Definition: Node.cpp:54
Definition: Node.h:142
std::vector< Node * > * getNeighbors()
Definition: Node.cpp:8
void setNeighbors(std::vector< Node * > *nodes)
Definition: Node.cpp:3
void setHasBlock(bool exists)
Definition: Node.cpp:23
void setBeClosed(bool closed_)
Definition: Node.cpp:79
bool isClosed()
Definition: Node.cpp:84
A*アルゴリズムにおけるノードクラス
void setRealCost(std::int32_t cost)
Definition: Node.cpp:69
std::int32_t getRealCost()
Definition: Node.cpp:74
void setParentNode(Node *parent)
Definition: Node.cpp:49
bool hasBlock()
Definition: Node.cpp:28
std::int8_t getNodeID()
Definition: Node.cpp:18
std::int8_t getPositionY()
Definition: Node.cpp:44
void setScore(std::int32_t score_)
Definition: Node.cpp:59
std::int32_t getScore()
Definition: Node.cpp:64