2008-12-26 03:46:53 +02:00
|
|
|
#ifndef __VCMI_LIB_H__
|
|
|
|
#define __VCMI_LIB_H__
|
|
|
|
#include "../global.h"
|
2009-01-30 20:36:00 +02:00
|
|
|
#ifndef _MSC_VER
|
|
|
|
#include "../hch/CArtHandler.h"
|
|
|
|
#include "../hch/CGeneralTextHandler.h"
|
|
|
|
#endif
|
2008-12-26 03:46:53 +02:00
|
|
|
|
|
|
|
class CLodHandler;
|
|
|
|
class CArtHandler;
|
|
|
|
class CHeroHandler;
|
|
|
|
class CCreatureHandler;
|
|
|
|
class CSpellHandler;
|
|
|
|
//class CPreGameTextHandler;
|
|
|
|
class CBuildingHandler;
|
|
|
|
class CObjectHandler;
|
|
|
|
//class CMusicHandler;
|
|
|
|
//class CSemiLodHandler;
|
|
|
|
class CDefObjInfoHandler;
|
|
|
|
class CTownHandler;
|
|
|
|
class CGeneralTextHandler;
|
|
|
|
//class CConsoleHandler;
|
|
|
|
//class CPathfinder;
|
|
|
|
//class CGameState;
|
|
|
|
|
2009-01-11 00:08:18 +02:00
|
|
|
class DLL_EXPORT LibClasses
|
2008-12-26 03:46:53 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CArtHandler * arth;
|
|
|
|
CHeroHandler * heroh;
|
|
|
|
CCreatureHandler * creh;
|
|
|
|
CSpellHandler * spellh;
|
|
|
|
CBuildingHandler * buildh;
|
|
|
|
CObjectHandler * objh;
|
|
|
|
CDefObjInfoHandler * dobjinfo;
|
|
|
|
CTownHandler * townh;
|
|
|
|
CGeneralTextHandler * generaltexth;
|
|
|
|
//CPathfinder * pathf;
|
2009-01-11 00:08:18 +02:00
|
|
|
|
|
|
|
void init(); //uses standard config file
|
|
|
|
void clear(); //deletes all handlers and its data
|
|
|
|
|
|
|
|
template <typename Handler> void serialize(Handler &h, const int version)
|
|
|
|
{
|
2009-01-12 22:05:56 +02:00
|
|
|
h & heroh & arth & creh & townh & objh & dobjinfo & buildh & spellh;
|
2009-01-11 00:08:18 +02:00
|
|
|
if(!h.saving)
|
|
|
|
{
|
|
|
|
generaltexth = new CGeneralTextHandler;
|
|
|
|
generaltexth->load();
|
2009-01-12 22:05:56 +02:00
|
|
|
arth->loadArtifacts(true);
|
2009-01-11 00:08:18 +02:00
|
|
|
}
|
|
|
|
}
|
2008-12-26 03:46:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
extern DLL_EXPORT LibClasses * VLC;
|
|
|
|
extern CLodHandler * bitmaph;
|
|
|
|
|
|
|
|
DLL_EXPORT void loadToIt(std::string &dest, std::string &src, int &iter, int mode);
|
|
|
|
DLL_EXPORT void loadToIt(si32 &dest, std::string &src, int &iter, int mode);
|
|
|
|
DLL_EXPORT void initDLL(CLodHandler *b, CConsoleHandler *Console, std::ostream *Logfile);
|
|
|
|
|
|
|
|
|
|
|
|
#endif // __VCMI_LIB_H__
|