123 : blockPositionList(MAX_BLOCK_COUNT),
124 movedBlockPositionList(MAX_BLOCK_COUNT, EMPTY_ID),
125 evacuatedBlockPositionList(MAX_BLOCK_COUNT, EMPTY_ID),
126 nodePositionCostList(TOTAL_NODE_COUNT),
127 routeBeforeOne_(TOTAL_NODE_COUNT, EMPTY_ID)
130 std::vector<int> nodePositionCostList_{ { 4, 3, 3, 4, 3, 2, 2, 3, 1, 2, 2, 3, 4, 3, 3, 4 } };
132 for(
unsigned int i = 0; i < nodePositionCostList_.size(); i++)
133 nodePositionCostList[i] = nodePositionCostList_[i];
186 std::vector<int>
searchRoute(std::int8_t start, std::int8_t end);
202 [[deprecated(
"memory is enlarged if this is used!!!")]]
void updateRoute(std::vector<int> route);
210 static const std::int8_t TOTAL_NODE_COUNT = 16;
215 static const std::int8_t MAX_BLOCK_COUNT = 4;
226 const std::int8_t EMPTY_ID = -1;
228 bool evacuatingFlag =
false;
230 bool movingFlag =
false;
232 bool carryingFlag =
false;
234 bool backsteppingFlag =
false;
236 bool backsteppingBeforeNextOeperationFlag =
false;
238 bool isCarriedToShelter =
false;
240 bool isClearGame =
false;
242 std::int8_t movedCount = 0;
244 std::int8_t evacuatedSize = 0;
246 std::int8_t lastBlock = EMPTY_ID;
248 std::vector<std::int8_t> blockPositionList;
250 std::vector<std::int8_t> movedBlockPositionList;
252 std::deque<std::int8_t> evacuatedBlockPositionList;
254 std::vector<int> nodePositionCostList;
256 std::vector<int> routeBeforeOne_;
std::int8_t searchMostPoorCostShelter(std::int8_t currentPosition)
void prepareSearching(std::vector< std::int8_t > list)
std::vector< int > searchRoute(std::int8_t start, std::int8_t end)
void updateRoute(std::vector< int > route)
std::vector< std::int8_t > getBlockPositionList()
std::int8_t getPositionOfCenterQuadirilateral(BlockColor color)
std::int8_t popEvacuatedBlockPosition()
bool isCarryingWithNext()
bool canFindBlockInEvacuatedList(std::int8_t position)
void setBlockPositionList(std::vector< std::int8_t > list)
bool isEvacuatingWithNext()
bool isAlreadyMovedNode(std::int8_t position)
std::vector< int > extractRoute()
void pushEvacuatedBlockPosition(std::int8_t position)
std::vector< int > exploreNextOperation(std::int8_t currentPosition, BlockColor color)
bool isAlreadyAllBlockMoved()
bool isBacksteppingBeforeNextOperation()
NextOperationOfSearchingRouteIs
void setNext(NextOperationOfSearchingRouteIs next)
void changeBlockPosition(std::int8_t beforePosition, std::int8_t afterPosition)
void addMovedBlockPosition(std::int8_t position)
std::int8_t searchBlockPosition(std::int8_t currentPosition)