VCMI_Lib.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. bool IS_AI_ENABLED; //VLC is teh only object visible from both CMT and GeniusAI
  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. LibClasses(); //c-tor, loads .lods and NULLs handlers
  37. void init(); //uses standard config file
  38. void clear(); //deletes all handlers and its data
  39. void makeNull(); //sets all handler (except of lodhs) pointers to null
  40. void callWhenDeserializing(); //should be called only by serialize !!!
  41. template <typename Handler> void serialize(Handler &h, const int version)
  42. {
  43. h & heroh & arth & creh & townh & objh & dobjinfo & buildh & spellh & IS_AI_ENABLED;;
  44. if(!h.saving)
  45. {
  46. callWhenDeserializing();
  47. }
  48. }
  49. };
  50. extern DLL_EXPORT LibClasses * VLC;
  51. extern DLL_EXPORT CLodHandler * bitmaph, *spriteh;
  52. DLL_EXPORT void loadToIt(std::string &dest, const std::string &src, int &iter, int mode);
  53. DLL_EXPORT void loadToIt(si32 &dest, const std::string &src, int &iter, int mode);
  54. DLL_EXPORT void initDLL(CConsoleHandler *Console, std::ostream *Logfile);
  55. #endif // __VCMI_LIB_H__