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

battlefields in VLC and custom bonuses for terrain patches

This commit is contained in:
Andrii Danylchenko
2022-06-28 11:05:30 +03:00
parent 3b1d271ae0
commit 4b4cc3cf4b
47 changed files with 645 additions and 221 deletions

View File

@ -32,6 +32,7 @@
#include "rmg/CRmgTemplateStorage.h"
#include "mapping/CMapEditManager.h"
#include "ScriptHandler.h"
#include "BattleFieldHandler.h"
LibClasses * VLC = nullptr;
@ -110,6 +111,11 @@ spells::effects::Registry * LibClasses::spellEffects()
return spells::effects::GlobalRegistry::get();
}
const BattleFieldService * LibClasses::battlefields() const
{
return battlefieldsHandler;
}
void LibClasses::updateEntity(Metatype metatype, int32_t index, const JsonNode & data)
{
switch(metatype)
@ -205,6 +211,8 @@ void LibClasses::init(bool onlyEssential)
createHandler(scriptHandler, "Script", pomtime);
createHandler(battlefieldsHandler, "Battlefields", pomtime);
logGlobal->info("\tInitializing handlers: %d ms", totalTime.getDiff());
modh->load();
@ -231,6 +239,7 @@ void LibClasses::clear()
delete tplh;
delete terviewh;
delete scriptHandler;
delete battlefieldsHandler;
makeNull();
}
@ -250,6 +259,7 @@ void LibClasses::makeNull()
tplh = nullptr;
terviewh = nullptr;
scriptHandler = nullptr;
battlefieldsHandler = nullptr;
}
LibClasses::LibClasses()