VCMI_Lib.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef __VCMI_LIB_H__
  2. #define __VCMI_LIB_H__
  3. #include "../global.h"
  4. class CLodHandler;
  5. class CArtHandler;
  6. class CHeroHandler;
  7. class CCreatureHandler;
  8. //class CAbilityHandler;
  9. class CSpellHandler;
  10. //class CPreGameTextHandler;
  11. class CBuildingHandler;
  12. class CObjectHandler;
  13. //class CMusicHandler;
  14. //class CSemiLodHandler;
  15. class CDefObjInfoHandler;
  16. class CTownHandler;
  17. class CGeneralTextHandler;
  18. //class CConsoleHandler;
  19. //class CPathfinder;
  20. //class CGameState;
  21. class DLL_EXPORT LibClasses
  22. {
  23. public:
  24. CArtHandler * arth;
  25. CHeroHandler * heroh;
  26. CCreatureHandler * creh;
  27. CSpellHandler * spellh;
  28. CBuildingHandler * buildh;
  29. CObjectHandler * objh;
  30. CDefObjInfoHandler * dobjinfo;
  31. CTownHandler * townh;
  32. CGeneralTextHandler * generaltexth;
  33. //CPathfinder * pathf;
  34. void init(); //uses standard config file
  35. void clear(); //deletes all handlers and its data
  36. template <typename Handler> void serialize(Handler &h, const int version)
  37. {
  38. h & heroh & arth & creh & townh & objh & dobjinfo & buildh & spellh;
  39. if(!h.saving)
  40. {
  41. generaltexth = new CGeneralTextHandler;
  42. generaltexth->load();
  43. arth->loadArtifacts(true);
  44. }
  45. }
  46. };
  47. extern DLL_EXPORT LibClasses * VLC;
  48. extern CLodHandler * bitmaph;
  49. DLL_EXPORT void loadToIt(std::string &dest, std::string &src, int &iter, int mode);
  50. DLL_EXPORT void loadToIt(si32 &dest, std::string &src, int &iter, int mode);
  51. DLL_EXPORT void initDLL(CLodHandler *b, CConsoleHandler *Console, std::ostream *Logfile);
  52. #endif // __VCMI_LIB_H__