VCMI_Lib.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 CPreGameTextHandler;
  19. class CBuildingHandler;
  20. class CObjectHandler;
  21. //class CMusicHandler;
  22. //class CSemiLodHandler;
  23. class CDefObjInfoHandler;
  24. class CTownHandler;
  25. class CGeneralTextHandler;
  26. //class CConsoleHandler;
  27. //class CPathfinder;
  28. //class CGameState;
  29. class DLL_EXPORT LibClasses
  30. {
  31. public:
  32. CArtHandler * arth;
  33. CHeroHandler * heroh;
  34. CCreatureHandler * creh;
  35. CSpellHandler * spellh;
  36. CBuildingHandler * buildh;
  37. CObjectHandler * objh;
  38. CDefObjInfoHandler * dobjinfo;
  39. CTownHandler * townh;
  40. CGeneralTextHandler * generaltexth;
  41. LibClasses(); //c-tor, loads .lods and NULLs handlers
  42. void init(); //uses standard config file
  43. void clear(); //deletes all handlers and its data
  44. void makeNull(); //sets all handler (except of lodhs) pointers to null
  45. void callWhenDeserializing(); //should be called only by serialize !!!
  46. template <typename Handler> void serialize(Handler &h, const int version)
  47. {
  48. h & heroh & arth & creh & townh & objh & dobjinfo & buildh & spellh;
  49. if(!h.saving)
  50. {
  51. callWhenDeserializing();
  52. }
  53. }
  54. };
  55. extern DLL_EXPORT LibClasses * VLC;
  56. extern DLL_EXPORT CLodHandler * bitmaph, *spriteh;
  57. DLL_EXPORT void loadToIt(std::string &dest, const std::string &src, int &iter, int mode);
  58. DLL_EXPORT void loadToIt(si32 &dest, const std::string &src, int &iter, int mode);
  59. DLL_EXPORT void initDLL(CConsoleHandler *Console, std::ostream *Logfile);
  60. #endif // __VCMI_LIB_H__