1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00

Use API identical to std classes where possible

This commit is contained in:
Ivan Savenko
2023-08-20 23:45:41 +03:00
parent 87957e74c1
commit 44d16b32fe
32 changed files with 72 additions and 87 deletions

View File

@ -13,8 +13,6 @@
VCMI_LIB_NAMESPACE_BEGIN
boost::thread_specific_ptr<CRandomGenerator> CRandomGenerator::defaultRand;
CRandomGenerator::CRandomGenerator()
{
resetSeed();
@ -84,11 +82,8 @@ double CRandomGenerator::nextDouble()
CRandomGenerator & CRandomGenerator::getDefault()
{
if(!defaultRand.get())
{
defaultRand.reset(new CRandomGenerator());
}
return *defaultRand;
static thread_local CRandomGenerator defaultRand;
return defaultRand;
}
TGenerator & CRandomGenerator::getStdGenerator()