VCMI_Lib.h 1.9 KB

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