1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

vstd::unique -> std::unique

This commit is contained in:
Ivan Savenko
2022-12-07 23:36:20 +02:00
parent 4d494b0941
commit facf77b3ae
48 changed files with 91 additions and 122 deletions

View File

@@ -123,24 +123,24 @@ CMap * CMapEditManager::getMap()
void CMapEditManager::clearTerrain(CRandomGenerator * gen)
{
execute(make_unique<CClearTerrainOperation>(map, gen ? gen : &(this->gen)));
execute(std::make_unique<CClearTerrainOperation>(map, gen ? gen : &(this->gen)));
}
void CMapEditManager::drawTerrain(TerrainId terType, CRandomGenerator * gen)
{
execute(make_unique<CDrawTerrainOperation>(map, terrainSel, terType, gen ? gen : &(this->gen)));
execute(std::make_unique<CDrawTerrainOperation>(map, terrainSel, terType, gen ? gen : &(this->gen)));
terrainSel.clearSelection();
}
void CMapEditManager::drawRoad(RoadId roadType, CRandomGenerator* gen)
{
execute(make_unique<CDrawRoadsOperation>(map, terrainSel, roadType, gen ? gen : &(this->gen)));
execute(std::make_unique<CDrawRoadsOperation>(map, terrainSel, roadType, gen ? gen : &(this->gen)));
terrainSel.clearSelection();
}
void CMapEditManager::drawRiver(RiverId riverType, CRandomGenerator* gen)
{
execute(make_unique<CDrawRiversOperation>(map, terrainSel, riverType, gen ? gen : &(this->gen)));
execute(std::make_unique<CDrawRiversOperation>(map, terrainSel, riverType, gen ? gen : &(this->gen)));
terrainSel.clearSelection();
}
@@ -148,35 +148,35 @@ void CMapEditManager::drawRiver(RiverId riverType, CRandomGenerator* gen)
void CMapEditManager::insertObject(CGObjectInstance * obj)
{
execute(make_unique<CInsertObjectOperation>(map, obj));
execute(std::make_unique<CInsertObjectOperation>(map, obj));
}
void CMapEditManager::insertObjects(std::set<CGObjectInstance*>& objects)
{
auto composedOperation = make_unique<CComposedOperation>(map);
auto composedOperation = std::make_unique<CComposedOperation>(map);
for (auto obj : objects)
{
composedOperation->addOperation(make_unique<CInsertObjectOperation>(map, obj));
composedOperation->addOperation(std::make_unique<CInsertObjectOperation>(map, obj));
}
execute(std::move(composedOperation));
}
void CMapEditManager::moveObject(CGObjectInstance * obj, const int3 & pos)
{
execute(make_unique<CMoveObjectOperation>(map, obj, pos));
execute(std::make_unique<CMoveObjectOperation>(map, obj, pos));
}
void CMapEditManager::removeObject(CGObjectInstance * obj)
{
execute(make_unique<CRemoveObjectOperation>(map, obj));
execute(std::make_unique<CRemoveObjectOperation>(map, obj));
}
void CMapEditManager::removeObjects(std::set<CGObjectInstance*> & objects)
{
auto composedOperation = make_unique<CComposedOperation>(map);
auto composedOperation = std::make_unique<CComposedOperation>(map);
for (auto obj : objects)
{
composedOperation->addOperation(make_unique<CRemoveObjectOperation>(map, obj));
composedOperation->addOperation(std::make_unique<CRemoveObjectOperation>(map, obj));
}
execute(std::move(composedOperation));
}