1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-20 20:23:03 +02:00
vcmi/lib/rmg/threadpool/MapProxy.cpp

61 lines
1.5 KiB
C++
Raw Normal View History

/*
* MapProxy.cpp, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#include "MapProxy.h"
#include "../../TerrainHandler.h"
VCMI_LIB_NAMESPACE_BEGIN
MapProxy::MapProxy(RmgMap & map):
2023-12-22 23:22:33 +02:00
map(map)
{
}
void MapProxy::insertObject(CGObjectInstance * obj)
{
2023-12-22 23:22:33 +02:00
Lock lock(mx);
map.getEditManager()->insertObject(obj);
}
void MapProxy::insertObjects(std::set<CGObjectInstance*>& objects)
{
2023-12-22 23:22:33 +02:00
Lock lock(mx);
map.getEditManager()->insertObjects(objects);
}
2023-08-11 20:13:25 +02:00
void MapProxy::removeObject(CGObjectInstance * obj)
{
2023-12-22 23:22:33 +02:00
Lock lock(mx);
map.getEditManager()->removeObject(obj);
2023-08-11 20:13:25 +02:00
}
void MapProxy::drawTerrain(CRandomGenerator & generator, std::vector<int3> & tiles, TerrainId terrain)
{
2023-12-22 23:22:33 +02:00
Lock lock(mx);
map.getEditManager()->getTerrainSelection().setSelection(tiles);
map.getEditManager()->drawTerrain(terrain, map.getDecorationsPercentage(), &generator);
}
void MapProxy::drawRivers(CRandomGenerator & generator, std::vector<int3> & tiles, TerrainId terrain)
{
2023-12-22 23:22:33 +02:00
Lock lock(mx);
map.getEditManager()->getTerrainSelection().setSelection(tiles);
map.getEditManager()->drawRiver(VLC->terrainTypeHandler->getById(terrain)->river, &generator);
}
void MapProxy::drawRoads(CRandomGenerator & generator, std::vector<int3> & tiles, RoadId roadType)
{
2023-12-22 23:22:33 +02:00
Lock lock(mx);
map.getEditManager()->getTerrainSelection().setSelection(tiles);
map.getEditManager()->drawRoad(roadType, &generator);
}
VCMI_LIB_NAMESPACE_END