CGameInfo.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * CGameInfo.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include <vcmi/Services.h>
  12. #include "../lib/ConstTransitivePtr.h"
  13. class CModHandler;
  14. class CMapHandler;
  15. class CHeroHandler;
  16. class CCreatureHandler;
  17. class CSpellHandler;
  18. class CSkillHandler;
  19. class CBuildingHandler;
  20. class CObjectHandler;
  21. class CSoundHandler;
  22. class CMusicHandler;
  23. class CObjectClassesHandler;
  24. class CTownHandler;
  25. class CGeneralTextHandler;
  26. class CConsoleHandler;
  27. class CCursorHandler;
  28. class CGameState;
  29. class IMainVideoPlayer;
  30. class CServerHandler;
  31. class BattleFieldHandler;
  32. class ObstacleHandler;
  33. class TerrainTypeHandler;
  34. class CMap;
  35. //a class for non-mechanical client GUI classes
  36. class CClientState
  37. {
  38. public:
  39. CSoundHandler * soundh;
  40. CMusicHandler * musich;
  41. CConsoleHandler * consoleh;
  42. CCursorHandler * curh;
  43. IMainVideoPlayer * videoh;
  44. };
  45. extern CClientState * CCS;
  46. /// CGameInfo class
  47. /// for allowing different functions for accessing game informations
  48. class CGameInfo : public Services
  49. {
  50. public:
  51. const ArtifactService * artifacts() const override;
  52. const CreatureService * creatures() const override;
  53. const FactionService * factions() const override;
  54. const HeroClassService * heroClasses() const override;
  55. const HeroTypeService * heroTypes() const override;
  56. #if SCRIPTING_ENABLED
  57. const scripting::Service * scripts() const override;
  58. #endif
  59. const spells::Service * spells() const override;
  60. const SkillService * skills() const override;
  61. const BattleFieldService * battlefields() const override;
  62. const ObstacleService * obstacles() const override;
  63. void updateEntity(Metatype metatype, int32_t index, const JsonNode & data) override;
  64. const spells::effects::Registry * spellEffects() const override;
  65. spells::effects::Registry * spellEffects() override;
  66. ConstTransitivePtr<CModHandler> modh; //public?
  67. ConstTransitivePtr<BattleFieldHandler> battleFieldHandler;
  68. ConstTransitivePtr<CHeroHandler> heroh;
  69. ConstTransitivePtr<CCreatureHandler> creh;
  70. ConstTransitivePtr<CSpellHandler> spellh;
  71. ConstTransitivePtr<CSkillHandler> skillh;
  72. ConstTransitivePtr<CObjectHandler> objh;
  73. ConstTransitivePtr<TerrainTypeHandler> terrainTypeHandler;
  74. ConstTransitivePtr<CObjectClassesHandler> objtypeh;
  75. ConstTransitivePtr<ObstacleHandler> obstacleHandler;
  76. CGeneralTextHandler * generaltexth;
  77. CMapHandler * mh;
  78. CTownHandler * townh;
  79. void setFromLib();
  80. CGameInfo();
  81. private:
  82. const Services * globalServices;
  83. };
  84. extern const CGameInfo* CGI;