65 Position() : x(0), y(0) {}
77 : blockAreaNodeList(nullptr), neighborPtrs(TOTAL_NODE_COUNT), neighborsIDList(TOTAL_NODE_COUNT)
80 std::vector<std::array<std::int8_t, MAX_NEIGHBOR_COUNT>> neighborsIDList_{
81 { { 1, 4, EMPTY_ID, EMPTY_ID },
82 { 0, 2, 5, EMPTY_ID },
83 { 1, 3, 6, EMPTY_ID },
84 { 2, 7, EMPTY_ID, EMPTY_ID },
86 { 0, 5, 8, EMPTY_ID },
89 { 3, 6, 11, EMPTY_ID },
91 { 4, 9, 12, EMPTY_ID },
94 { 7, 10, 15, EMPTY_ID },
96 { 8, 13, EMPTY_ID, EMPTY_ID },
97 { 9, 12, 14, EMPTY_ID },
98 { 10, 13, 15, EMPTY_ID },
99 { 11, 14, EMPTY_ID, EMPTY_ID } }
103 std::vector<std::array<std::int8_t, 2>> currentPosition
104 = { { 0, 0 }, { 1, 0 }, { 2, 0 }, { 3, 0 },
106 { 0, 1 }, { 1, 1 }, { 2, 1 }, { 3, 1 },
108 { 0, 2 }, { 1, 2 }, { 2, 2 }, { 3, 2 },
110 { 0, 3 }, { 1, 3 }, { 2, 3 }, { 3, 3 } };
116 for(
unsigned int i = 0; i < neighborsIDList_.size(); i++) {
117 neighborsIDList[i] = neighborsIDList_[i];
120 for(
unsigned int i = 0; i < neighborsIDList.size(); i++) {
122 position.x = currentPosition[i][0];
123 position.y = currentPosition[i][1];
124 positionList.push_back(position);
177 std::vector<int>
searchRoute(std::int8_t start, std::int8_t end);
207 std::vector<Node*>* blockAreaNodeList;
212 std::vector<Position> positionList;
223 const std::int8_t EMPTY_ID = -1;
228 static const std::int8_t TOTAL_NODE_COUNT = 16;
233 static const std::int8_t MAX_NEIGHBOR_COUNT = 4;
242 std::vector<Node> nodeList;
251 std::vector<Node*> nodePtrs;
260 std::vector<std::vector<Node*>> neighborPtrs;
282 std::vector<std::array<std::int8_t, MAX_NEIGHBOR_COUNT>> neighborsIDList;
std::vector< Node * > * getBlockAreaNodeList()
bool hasBlock(std::int8_t id)
Node * calculateNeighborCost(Node *parent, std::vector< Node * > *around, std::int32_t realCost, std::int8_t end)
void setHasBlockIn(std::int8_t blockID)
std::vector< int > searchRoute(std::int8_t start, std::int8_t end)