1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-01 00:45:26 +02:00

Added move constructors for minimum required Bonus system`s classes

This commit is contained in:
AlexVinS
2016-07-29 12:27:55 +03:00
parent d188b86a50
commit 629922f43e
4 changed files with 53 additions and 1 deletions

View File

@ -2924,6 +2924,25 @@ PlayerState::PlayerState()
setNodeType(PLAYER);
}
PlayerState::PlayerState(PlayerState && other):
CBonusSystemNode(std::move(other)),
color(other.color),
human(other.human),
team(other.team),
resources(other.resources),
enteredWinningCheatCode(other.enteredWinningCheatCode),
enteredLosingCheatCode(other.enteredLosingCheatCode),
status(other.status),
daysWithoutCastle(other.daysWithoutCastle)
{
std::swap(visitedObjects, other.visitedObjects);
std::swap(heroes, other.heroes);
std::swap(towns, other.towns);
std::swap(availableHeroes, other.availableHeroes);
std::swap(dwellings, other.dwellings);
std::swap(quests, other.quests);
}
std::string PlayerState::nodeName() const
{
return "Player " + (color.getNum() < VLC->generaltexth->capColors.size() ? VLC->generaltexth->capColors[color.getNum()] : boost::lexical_cast<std::string>(color));
@ -3223,6 +3242,15 @@ TeamState::TeamState()
setNodeType(TEAM);
}
TeamState::TeamState(TeamState && other):
CBonusSystemNode(std::move(other)),
id(other.id)
{
std::swap(players, other.players);
std::swap(fogOfWarMap, other.fogOfWarMap);
}
CRandomGenerator & CGameState::getRandomGenerator()
{
//logGlobal->traceStream() << "Fetching CGameState::rand with seed " << rand.nextInt();