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

GameRandomizer is now in lib, add implementation

This commit is contained in:
Ivan Savenko
2025-05-18 10:52:48 +03:00
parent 54a46b77a9
commit cc274c4d34
31 changed files with 455 additions and 463 deletions

View File

@@ -11,7 +11,6 @@
#include "NewTurnProcessor.h"
#include "HeroPoolProcessor.h"
#include "RandomizationProcessor.h"
#include "../CGameHandler.h"
@@ -19,6 +18,7 @@
#include "../../lib/IGameSettings.h"
#include "../../lib/StartInfo.h"
#include "../../lib/TerrainHandler.h"
#include "../../lib/callback/GameRandomizer.h"
#include "../../lib/constants/StringConstants.h"
#include "../../lib/entities/building/CBuilding.h"
#include "../../lib/entities/faction/CTownHandler.h"
@@ -525,7 +525,7 @@ std::tuple<EWeekType, CreatureID> NewTurnProcessor::pickWeekType(bool newMonth)
{
if (gameHandler->getSettings().getBoolean(EGameSettings::CREATURES_ALLOW_ALL_FOR_DOUBLE_MONTH))
{
CreatureID creatureID = gameHandler->randomizationProcessor->rollCreature();
CreatureID creatureID = gameHandler->randomizer->rollCreature();
return { EWeekType::DOUBLE_GROWTH, creatureID};
}
else if (LIBRARY->creh->doubledCreatures.size())
@@ -552,7 +552,7 @@ std::tuple<EWeekType, CreatureID> NewTurnProcessor::pickWeekType(bool newMonth)
std::pair<int, CreatureID> newMonster(54, CreatureID());
do
{
newMonster.second = gameHandler->randomizationProcessor->rollCreature();
newMonster.second = gameHandler->randomizer->rollCreature();
} while (newMonster.second.toEntity(LIBRARY)->getFactionID().toFaction()->town == nullptr); // find first non neutral creature
return { EWeekType::BONUS_GROWTH, newMonster.second};