CGameInfo.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #pragma once
  2. #include "../lib/ConstTransitivePtr.h"
  3. /*
  4. * CGameInfo.h, part of VCMI engine
  5. *
  6. * Authors: listed in file AUTHORS in main folder
  7. *
  8. * License: GNU General Public License v2.0 or later
  9. * Full text of license available in license.txt file, in main folder
  10. *
  11. */
  12. class CMapHandler;
  13. class CArtHandler;
  14. class CHeroHandler;
  15. class CCreatureHandler;
  16. class CSpellHandler;
  17. class CBuildingHandler;
  18. class CObjectHandler;
  19. class CSoundHandler;
  20. class CMusicHandler;
  21. class CDefObjInfoHandler;
  22. class CTownHandler;
  23. class CGeneralTextHandler;
  24. class CConsoleHandler;
  25. class CCursorHandler;
  26. class CGameState;
  27. class IMainVideoPlayer;
  28. //a class for non-mechanical client GUI classes
  29. class CClientState
  30. {
  31. public:
  32. CSoundHandler * soundh;
  33. CMusicHandler * musich;
  34. CConsoleHandler * consoleh;
  35. CCursorHandler * curh;
  36. IMainVideoPlayer * videoh;
  37. };
  38. extern CClientState * CCS;
  39. struct Mapa;
  40. /// CGameInfo class
  41. /// for allowing different functions for accessing game informations
  42. class CGameInfo
  43. {
  44. ConstTransitivePtr<CGameState> state; //don't touch it in client's code
  45. public:
  46. ConstTransitivePtr<CArtHandler> arth;
  47. ConstTransitivePtr<CHeroHandler> heroh;
  48. ConstTransitivePtr<CCreatureHandler> creh;
  49. ConstTransitivePtr<CSpellHandler> spellh;
  50. ConstTransitivePtr<CObjectHandler> objh;
  51. ConstTransitivePtr<CDefObjInfoHandler> dobjinfo;
  52. CGeneralTextHandler * generaltexth;
  53. CMapHandler * mh;
  54. ConstTransitivePtr<CBuildingHandler> buildh;
  55. CTownHandler * townh;
  56. //CTownHandler * townh;
  57. void setFromLib();
  58. friend class CClient;
  59. friend void initVillagesCapitols(Mapa * map);
  60. CGameInfo();
  61. };
  62. extern const CGameInfo* CGI;