VCMI_Lib.h 1.5 KB

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