1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +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

@@ -17,7 +17,11 @@ VCMI_LIB_NAMESPACE_BEGIN
class CGObjectInstance;
class CMap;
class CRandomGenerator;
namespace vstd
{
class RNG;
}
/// The abstract base class CMapOperation defines an operation that can be executed, undone and redone.
class DLL_LINKAGE CMapOperation : public boost::noncopyable
@@ -63,7 +67,7 @@ private:
class CDrawTerrainOperation : public CMapOperation
{
public:
CDrawTerrainOperation(CMap * map, CTerrainSelection terrainSel, TerrainId terType, int decorationsPercentage, CRandomGenerator * gen);
CDrawTerrainOperation(CMap * map, CTerrainSelection terrainSel, TerrainId terType, int decorationsPercentage, vstd::RNG * gen);
void execute() override;
void undo() override;
@@ -103,7 +107,7 @@ private:
CTerrainSelection terrainSel;
TerrainId terType;
int decorationsPercentage;
CRandomGenerator* gen;
vstd::RNG* gen;
std::set<int3> invalidatedTerViews;
};
@@ -111,7 +115,7 @@ private:
class CClearTerrainOperation : public CComposedOperation
{
public:
CClearTerrainOperation(CMap * map, CRandomGenerator * gen);
CClearTerrainOperation(CMap * map, vstd::RNG * gen);
std::string getLabel() const override;
};