Revert "Board: 简化 = 重载符函数"

This reverts commit be8b1d4baa.
This commit is contained in:
Calcitem 2019-12-08 14:42:50 +08:00
parent 502fc471de
commit ce6d9c2f2f
1 changed files with 12 additions and 1 deletions

View File

@ -45,9 +45,20 @@ Board::~Board()
Board &Board::operator= (const Board &other)
{
if (this == &other)
return *this;
memcpy(this->locations, other.locations, sizeof(this->locations));
// TODO: 确定 millList 确实不用复制?
if (!millList.empty()) {
millList.clear();
}
if (!other.millList.empty()) {
for (auto i : other.millList) {
millList.push_back(i);
}
}
return *this;
}