1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Replaced most of usages of CRandomGenerator with vstd::RNG in library

This commit is contained in:
Ivan Savenko
2024-06-01 15:28:17 +00:00
parent 60a51e98de
commit 63bcf7d83c
125 changed files with 620 additions and 409 deletions

View File

@@ -37,21 +37,21 @@ void MapProxy::removeObject(CGObjectInstance * obj)
map.getEditManager()->removeObject(obj);
}
void MapProxy::drawTerrain(CRandomGenerator & generator, std::vector<int3> & tiles, TerrainId terrain)
void MapProxy::drawTerrain(vstd::RNG & generator, std::vector<int3> & tiles, TerrainId terrain)
{
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)
void MapProxy::drawRivers(vstd::RNG & generator, std::vector<int3> & tiles, TerrainId terrain)
{
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)
void MapProxy::drawRoads(vstd::RNG & generator, std::vector<int3> & tiles, RoadId roadType)
{
Lock lock(mx);
map.getEditManager()->getTerrainSelection().setSelection(tiles);

View File

@@ -28,9 +28,9 @@ public:
void insertObjects(std::set<CGObjectInstance*>& objects);
void removeObject(CGObjectInstance* obj);
void drawTerrain(CRandomGenerator & generator, std::vector<int3> & tiles, TerrainId terrain);
void drawRivers(CRandomGenerator & generator, std::vector<int3> & tiles, TerrainId terrain);
void drawRoads(CRandomGenerator & generator, std::vector<int3> & tiles, RoadId roadType);
void drawTerrain(vstd::RNG & generator, std::vector<int3> & tiles, TerrainId terrain);
void drawRivers(vstd::RNG & generator, std::vector<int3> & tiles, TerrainId terrain);
void drawRoads(vstd::RNG & generator, std::vector<int3> & tiles, RoadId roadType);
private:
mutable boost::shared_mutex mx;