mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Replaced most of usages of CRandomGenerator with vstd::RNG in library
This commit is contained in:
@ -14,11 +14,12 @@
|
||||
#include "../mapping/CMapHeader.h"
|
||||
#include "CRmgTemplateStorage.h"
|
||||
#include "CRmgTemplate.h"
|
||||
#include "CRandomGenerator.h"
|
||||
#include "../VCMI_Lib.h"
|
||||
#include "../CTownHandler.h"
|
||||
#include "serializer/JsonSerializeFormat.h"
|
||||
|
||||
#include <vstd/RNG.h>
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
CMapGenOptions::CMapGenOptions()
|
||||
@ -487,7 +488,7 @@ void CMapGenOptions::setPlayerTeam(const PlayerColor & color, const TeamID & tea
|
||||
customizedPlayers = true;
|
||||
}
|
||||
|
||||
void CMapGenOptions::finalize(CRandomGenerator & rand)
|
||||
void CMapGenOptions::finalize(vstd::RNG & rand)
|
||||
{
|
||||
logGlobal->info("RMG map: %dx%d, %s underground", getWidth(), getHeight(), getHasTwoLevels() ? "WITH" : "NO");
|
||||
logGlobal->info("RMG settings: players %d, teams %d, computer players %d, computer teams %d, water %d, monsters %d",
|
||||
@ -690,8 +691,7 @@ bool CMapGenOptions::checkOptions() const
|
||||
}
|
||||
else
|
||||
{
|
||||
CRandomGenerator gen;
|
||||
return getPossibleTemplate(gen) != nullptr;
|
||||
return !getPossibleTemplates().empty();
|
||||
}
|
||||
}
|
||||
|
||||
@ -750,7 +750,7 @@ std::vector<const CRmgTemplate *> CMapGenOptions::getPossibleTemplates() const
|
||||
return templates;
|
||||
}
|
||||
|
||||
const CRmgTemplate * CMapGenOptions::getPossibleTemplate(CRandomGenerator & rand) const
|
||||
const CRmgTemplate * CMapGenOptions::getPossibleTemplate(vstd::RNG & rand) const
|
||||
{
|
||||
auto templates = getPossibleTemplates();
|
||||
|
||||
|
Reference in New Issue
Block a user