?? rnode.cpp
字號:
#include "RNode.h"
#include <iostream>
#include <cmath>
using namespace std;
RNode::RNode(int nodeState) {
this->nodeState = nodeState;
this->fatherNode = NULL;
}
RNode::RNode(int nodeState, RNode* fatherNode) {
this->nodeState = nodeState;
this->fatherNode = fatherNode;
}
int RNode::getnodeState() const {
return nodeState;
}
int RNode::move(int method) const {
int swap = nodeState;
switch(method) {
case 0: //(-1, 0, 1, 0)
return -(swap-1000+10);
case 1: //(-2, 0, 2, 0)
return -(swap-2000+20);
case 2: //(0, -1, 0, 1)
return -(swap-100+1);
case 3: //(0, -2, 0, 2)
return -(swap-200+2);
case 4: //(-1, -1, 1, 1)
return -(swap-1100+11);
}
}
RNode* RNode::getfatherNode() const {
return fatherNode;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -