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

Basic Configuration for bonus types

* introduced new handler BonusTypeHandler
* config\bonusnames.json converted to common format and splitted info main and localizable parts
* hanlders initialization refactored
This commit is contained in:
alexvins
2013-03-06 18:49:56 +00:00
parent 6b5ee0b674
commit 2eb8263e51
28 changed files with 1481 additions and 517 deletions

View File

@ -20,14 +20,21 @@ class CDefObjInfoHandler;
class CTownHandler;
class CGeneralTextHandler;
class CModHandler;
class IBonusTypeHandler;
class CBonusTypeHandler;
/// Loads and constructs several handlers
class DLL_LINKAGE LibClasses
{
CBonusTypeHandler * bth;
void callWhenDeserializing(); //should be called only by serialize !!!
void makeNull(); //sets all handler pointers to null
public:
bool IS_AI_ENABLED; //VLC is the only object visible from both CMT and GeniusAI
const IBonusTypeHandler * getBth() const;
CArtHandler * arth;
CHeroHandler * heroh;
CCreatureHandler * creh;
@ -49,7 +56,8 @@ public:
template <typename Handler> void serialize(Handler &h, const int version)
{
h & heroh & arth & creh & townh & objh & dobjinfo & spellh & modh & IS_AI_ENABLED;;
h & heroh & arth & creh & townh & objh & dobjinfo & spellh & modh & IS_AI_ENABLED;
h & bth;
if(!h.saving)
{
callWhenDeserializing();