VCMI_Lib.h 1.5 KB

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