VCMI_Lib.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef __VCMI_LIB_H__
  2. #define __VCMI_LIB_H__
  3. #include "../global.h"
  4. /*
  5. * VCMI_Lib.h, part of VCMI engine
  6. *
  7. * Authors: listed in file AUTHORS in main folder
  8. *
  9. * License: GNU General Public License v2.0 or later
  10. * Full text of license available in license.txt file, in main folder
  11. *
  12. */
  13. class CLodHandler;
  14. class CArtHandler;
  15. class CHeroHandler;
  16. class CCreatureHandler;
  17. class CSpellHandler;
  18. class CBuildingHandler;
  19. class CObjectHandler;
  20. class CDefObjInfoHandler;
  21. class CTownHandler;
  22. class CGeneralTextHandler;
  23. class DLL_EXPORT LibClasses
  24. {
  25. public:
  26. CArtHandler * arth;
  27. CHeroHandler * heroh;
  28. CCreatureHandler * creh;
  29. CSpellHandler * spellh;
  30. CBuildingHandler * buildh;
  31. CObjectHandler * objh;
  32. CDefObjInfoHandler * dobjinfo;
  33. CTownHandler * townh;
  34. CGeneralTextHandler * generaltexth;
  35. LibClasses(); //c-tor, loads .lods and NULLs handlers
  36. void init(); //uses standard config file
  37. void clear(); //deletes all handlers and its data
  38. void makeNull(); //sets all handler (except of lodhs) pointers to null
  39. void callWhenDeserializing(); //should be called only by serialize !!!
  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. callWhenDeserializing();
  46. }
  47. }
  48. };
  49. extern DLL_EXPORT LibClasses * VLC;
  50. extern DLL_EXPORT CLodHandler * bitmaph, *spriteh;
  51. DLL_EXPORT void loadToIt(std::string &dest, const std::string &src, int &iter, int mode);
  52. DLL_EXPORT void loadToIt(si32 &dest, const std::string &src, int &iter, int mode);
  53. DLL_EXPORT void initDLL(CConsoleHandler *Console, std::ostream *Logfile);
  54. #endif // __VCMI_LIB_H__