VCMI_Lib.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. /*
  9. * VCMI_Lib.h, part of VCMI engine
  10. *
  11. * Authors: listed in file AUTHORS in main folder
  12. *
  13. * License: GNU General Public License v2.0 or later
  14. * Full text of license available in license.txt file, in main folder
  15. *
  16. */
  17. class CLodHandler;
  18. class CArtHandler;
  19. class CHeroHandler;
  20. class CCreatureHandler;
  21. class CSpellHandler;
  22. //class CPreGameTextHandler;
  23. class CBuildingHandler;
  24. class CObjectHandler;
  25. //class CMusicHandler;
  26. //class CSemiLodHandler;
  27. class CDefObjInfoHandler;
  28. class CTownHandler;
  29. class CGeneralTextHandler;
  30. //class CConsoleHandler;
  31. //class CPathfinder;
  32. //class CGameState;
  33. class DLL_EXPORT LibClasses
  34. {
  35. public:
  36. CArtHandler * arth;
  37. CHeroHandler * heroh;
  38. CCreatureHandler * creh;
  39. CSpellHandler * spellh;
  40. CBuildingHandler * buildh;
  41. CObjectHandler * objh;
  42. CDefObjInfoHandler * dobjinfo;
  43. CTownHandler * townh;
  44. CGeneralTextHandler * generaltexth;
  45. //CPathfinder * pathf;
  46. void init(); //uses standard config file
  47. void clear(); //deletes all handlers and its data
  48. template <typename Handler> void serialize(Handler &h, const int version)
  49. {
  50. h & heroh & arth & creh & townh & objh & dobjinfo & buildh & spellh;
  51. if(!h.saving)
  52. {
  53. generaltexth = new CGeneralTextHandler;
  54. generaltexth->load();
  55. arth->loadArtifacts(true);
  56. }
  57. }
  58. };
  59. extern DLL_EXPORT LibClasses * VLC;
  60. extern DLL_EXPORT CLodHandler * bitmaph, *spriteh;
  61. DLL_EXPORT void loadToIt(std::string &dest, std::string &src, int &iter, int mode);
  62. DLL_EXPORT void loadToIt(si32 &dest, std::string &src, int &iter, int mode);
  63. DLL_EXPORT void initDLL(CConsoleHandler *Console, std::ostream *Logfile);
  64. #endif // __VCMI_LIB_H__