1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

sort town feature

This commit is contained in:
Laserlicht
2023-10-15 14:31:33 +02:00
committed by GitHub
parent e052a96637
commit 3b853bff08
11 changed files with 62 additions and 10 deletions

View File

@ -269,3 +269,9 @@ void PlayerLocalState::removeOwnedTown(const CGTownInstance * town)
if (currentSelection == nullptr && !ownedTowns.empty())
setSelection(ownedTowns.front());
}
void PlayerLocalState::swapOwnedTowns(int pos1, int pos2)
{
assert(ownedTowns[pos1] && ownedTowns[pos2]);
std::swap(ownedTowns[pos1], ownedTowns[pos2]);
}