location 由32位改为8位并新建 location_t 类型

This commit is contained in:
Calcitem 2019-09-29 00:15:48 +08:00
parent fd0ce863b0
commit d3a79d8e19
5 changed files with 6 additions and 5 deletions

View File

@ -124,7 +124,7 @@ public:
(location[i] & 0x10)
(location[i] & 0x20)
*/
int locations[N_LOCATIONS]{};
location_t locations[N_LOCATIONS]{};
/*

View File

@ -904,7 +904,7 @@ bool Game::win(bool forceDraw)
// 计算玩家1和玩家2的棋子活动能力之差
int Game::getMobilityDiff(player_t turn, int nPiecesOnBoard[], bool includeFobidden)
{
int *locations = boardLocations;
location_t *locations = boardLocations;
int mobility1 = 0;
int mobility2 = 0;
int diff = 0;

View File

@ -105,7 +105,7 @@ public:
bool setPosition(const struct Rule *rule);
// 获取棋盘数据
int *getBoardLocations() const
location_t *getBoardLocations() const
{
return boardLocations;
}
@ -257,7 +257,7 @@ public: /* TODO: move to private */
Position position;
// 棋局中的棋盘数据,单独提出来
int *boardLocations;
location_t *boardLocations;
// 棋谱
list <string> cmdlist;

View File

@ -26,6 +26,7 @@
using step_t = uint16_t;
using depth_t = uint8_t;
using location_t = uint8_t;
#ifdef TRANSPOSITION_TABLE_CUTDOWN
using hash_t = uint32_t;

View File

@ -978,7 +978,7 @@ bool GameController::updateScence()
bool GameController::updateScence(Game &g)
{
const int *board = g.getBoardLocations();
const location_t *board = g.getBoardLocations();
QPointF pos;
// game类中的棋子代码