1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-29 00:41:38 +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
AI/BattleAI
client
include/vstd
lib
CArtHandler.hCCreatureHandler.cppCCreatureHandler.hCHeroHandler.cppCHeroHandler.hCRandomGenerator.cppCRandomGenerator.hIGameCallback.cppIGameCallback.h
battle
gameState
json
mapObjectConstructors
mapObjects
mapping
registerTypes
rewardable
rmg
spells
mapeditor
server
test/mock

@ -21,6 +21,8 @@
#include "../mapObjectConstructors/CObjectClassesHandler.h"
#include "../VCMI_Lib.h"
#include <vstd/RNG.h>
VCMI_LIB_NAMESPACE_BEGIN
rmg::Tileset collectDistantTiles(const Zone& zone, int distance)
@ -34,7 +36,7 @@ rmg::Tileset collectDistantTiles(const Zone& zone, int distance)
return subarea.getTiles();
}
int chooseRandomAppearance(CRandomGenerator & generator, si32 ObjID, TerrainId terrain)
int chooseRandomAppearance(vstd::RNG & generator, si32 ObjID, TerrainId terrain)
{
auto factories = VLC->objtypeh->knownSubObjects(ObjID);
vstd::erase_if(factories, [ObjID, &terrain](si32 f)