location 由32位改为8位并新建 location_t 类型
This commit is contained in:
parent
fd0ce863b0
commit
d3a79d8e19
|
@ -124,7 +124,7 @@ public:
|
||||||
判断棋子是先手的用 (location[i] & 0x10)
|
判断棋子是先手的用 (location[i] & 0x10)
|
||||||
判断棋子是后手的用 (location[i] & 0x20)
|
判断棋子是后手的用 (location[i] & 0x20)
|
||||||
*/
|
*/
|
||||||
int locations[N_LOCATIONS]{};
|
location_t locations[N_LOCATIONS]{};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
本打算用如下的结构体来表示“三连”
|
本打算用如下的结构体来表示“三连”
|
||||||
|
|
|
@ -904,7 +904,7 @@ bool Game::win(bool forceDraw)
|
||||||
// 计算玩家1和玩家2的棋子活动能力之差
|
// 计算玩家1和玩家2的棋子活动能力之差
|
||||||
int Game::getMobilityDiff(player_t turn, int nPiecesOnBoard[], bool includeFobidden)
|
int Game::getMobilityDiff(player_t turn, int nPiecesOnBoard[], bool includeFobidden)
|
||||||
{
|
{
|
||||||
int *locations = boardLocations;
|
location_t *locations = boardLocations;
|
||||||
int mobility1 = 0;
|
int mobility1 = 0;
|
||||||
int mobility2 = 0;
|
int mobility2 = 0;
|
||||||
int diff = 0;
|
int diff = 0;
|
||||||
|
|
|
@ -105,7 +105,7 @@ public:
|
||||||
bool setPosition(const struct Rule *rule);
|
bool setPosition(const struct Rule *rule);
|
||||||
|
|
||||||
// 获取棋盘数据
|
// 获取棋盘数据
|
||||||
int *getBoardLocations() const
|
location_t *getBoardLocations() const
|
||||||
{
|
{
|
||||||
return boardLocations;
|
return boardLocations;
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ public: /* TODO: move to private */
|
||||||
Position position;
|
Position position;
|
||||||
|
|
||||||
// 棋局中的棋盘数据,单独提出来
|
// 棋局中的棋盘数据,单独提出来
|
||||||
int *boardLocations;
|
location_t *boardLocations;
|
||||||
|
|
||||||
// 棋谱
|
// 棋谱
|
||||||
list <string> cmdlist;
|
list <string> cmdlist;
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
using step_t = uint16_t;
|
using step_t = uint16_t;
|
||||||
using depth_t = uint8_t;
|
using depth_t = uint8_t;
|
||||||
|
using location_t = uint8_t;
|
||||||
|
|
||||||
#ifdef TRANSPOSITION_TABLE_CUTDOWN
|
#ifdef TRANSPOSITION_TABLE_CUTDOWN
|
||||||
using hash_t = uint32_t;
|
using hash_t = uint32_t;
|
||||||
|
|
|
@ -978,7 +978,7 @@ bool GameController::updateScence()
|
||||||
|
|
||||||
bool GameController::updateScence(Game &g)
|
bool GameController::updateScence(Game &g)
|
||||||
{
|
{
|
||||||
const int *board = g.getBoardLocations();
|
const location_t *board = g.getBoardLocations();
|
||||||
QPointF pos;
|
QPointF pos;
|
||||||
|
|
||||||
// game类中的棋子代码
|
// game类中的棋子代码
|
||||||
|
|
Loading…
Reference in New Issue