CGameInfo.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * CGameInfo.cpp, 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. #include "StdInc.h"
  11. #include "CGameInfo.h"
  12. #include "../lib/VCMI_Lib.h"
  13. const CGameInfo * CGI;
  14. CClientState * CCS = nullptr;
  15. CServerHandler * CSH;
  16. CGameInfo::CGameInfo()
  17. {
  18. generaltexth = nullptr;
  19. mh = nullptr;
  20. townh = nullptr;
  21. globalServices = nullptr;
  22. }
  23. void CGameInfo::setFromLib()
  24. {
  25. globalServices = VLC;
  26. modh = VLC->modh;
  27. generaltexth = VLC->generaltexth;
  28. creh = VLC->creh;
  29. townh = VLC->townh;
  30. heroh = VLC->heroh;
  31. objh = VLC->objh;
  32. spellh = VLC->spellh;
  33. skillh = VLC->skillh;
  34. objtypeh = VLC->objtypeh;
  35. battleFieldHandler = VLC->battlefieldsHandler;
  36. }
  37. const ArtifactService * CGameInfo::artifacts() const
  38. {
  39. return globalServices->artifacts();
  40. }
  41. const BattleFieldService * CGameInfo::battlefields() const
  42. {
  43. return globalServices->battlefields();
  44. }
  45. const CreatureService * CGameInfo::creatures() const
  46. {
  47. return globalServices->creatures();
  48. }
  49. const FactionService * CGameInfo::factions() const
  50. {
  51. return globalServices->factions();
  52. }
  53. const HeroClassService * CGameInfo::heroClasses() const
  54. {
  55. return globalServices->heroClasses();
  56. }
  57. const HeroTypeService * CGameInfo::heroTypes() const
  58. {
  59. return globalServices->heroTypes();
  60. }
  61. const scripting::Service * CGameInfo::scripts() const
  62. {
  63. return globalServices->scripts();
  64. }
  65. const spells::Service * CGameInfo::spells() const
  66. {
  67. return globalServices->spells();
  68. }
  69. const SkillService * CGameInfo::skills() const
  70. {
  71. return globalServices->skills();
  72. }
  73. void CGameInfo::updateEntity(Metatype metatype, int32_t index, const JsonNode & data)
  74. {
  75. logGlobal->error("CGameInfo::updateEntity call is not expected.");
  76. }
  77. spells::effects::Registry * CGameInfo::spellEffects()
  78. {
  79. return nullptr;
  80. }
  81. const spells::effects::Registry * CGameInfo::spellEffects() const
  82. {
  83. return globalServices->spellEffects();
  84. }