将tips从Position中提出来作为全局变量
以解决运行到一半疑似对tips重复释放导致崩溃的问题。 目前原因不明。不过tips迟早是要提取出来的。
This commit is contained in:
parent
f864c7bbc4
commit
3b40e4b0d6
|
@ -26,6 +26,9 @@
|
|||
#include "option.h"
|
||||
#include "zobrist.h"
|
||||
|
||||
// 当前棋局的字符提示
|
||||
string tips;
|
||||
|
||||
StateInfo::StateInfo()
|
||||
{
|
||||
if (position != nullptr) {
|
||||
|
@ -118,7 +121,7 @@ Position &Position::operator= (const Position &pos)
|
|||
move = pos.move;
|
||||
memcpy(cmdline, pos.cmdline, sizeof(cmdline));
|
||||
cmdlist = pos.cmdlist;
|
||||
tips = pos.tips;
|
||||
//tips = pos.tips;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
@ -143,7 +146,7 @@ Position &Position::operator= (Position &pos)
|
|||
move = pos.move;
|
||||
memcpy(cmdline, pos.cmdline, sizeof(cmdline));
|
||||
cmdlist = pos.cmdlist;
|
||||
tips = pos.tips;
|
||||
//tips = pos.tips;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
|
|
@ -39,6 +39,8 @@ class AIAlgorithm;
|
|||
class StateInfo;
|
||||
class Node;
|
||||
|
||||
extern string tips;
|
||||
|
||||
// 棋局结构体,算法相关,包含当前棋盘数据
|
||||
// 单独分离出来供AI判断局面用,生成置换表时使用
|
||||
class Position
|
||||
|
@ -340,9 +342,6 @@ private:
|
|||
|
||||
// 玩家用时(秒)
|
||||
time_t elapsedSeconds[COLOR_COUNT];
|
||||
|
||||
// 当前棋局的字符提示
|
||||
string tips;
|
||||
};
|
||||
|
||||
// 棋类(在数据模型内,玩家只分先后手,不分黑白)
|
||||
|
|
Loading…
Reference in New Issue