2
0

CGameInfo.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. }
  36. const ArtifactService * CGameInfo::artifacts() const
  37. {
  38. return globalServices->artifacts();
  39. }
  40. const CreatureService * CGameInfo::creatures() const
  41. {
  42. return globalServices->creatures();
  43. }
  44. const FactionService * CGameInfo::factions() const
  45. {
  46. return globalServices->factions();
  47. }
  48. const HeroClassService * CGameInfo::heroClasses() const
  49. {
  50. return globalServices->heroClasses();
  51. }
  52. const HeroTypeService * CGameInfo::heroTypes() const
  53. {
  54. return globalServices->heroTypes();
  55. }
  56. const scripting::Service * CGameInfo::scripts() const
  57. {
  58. return globalServices->scripts();
  59. }
  60. const spells::Service * CGameInfo::spells() const
  61. {
  62. return globalServices->spells();
  63. }
  64. const SkillService * CGameInfo::skills() const
  65. {
  66. return globalServices->skills();
  67. }
  68. void CGameInfo::updateEntity(Metatype metatype, int32_t index, const JsonNode & data)
  69. {
  70. logGlobal->error("CGameInfo::updateEntity call is not expected.");
  71. }
  72. spells::effects::Registry * CGameInfo::spellEffects()
  73. {
  74. return nullptr;
  75. }
  76. const spells::effects::Registry * CGameInfo::spellEffects() const
  77. {
  78. return globalServices->spellEffects();
  79. }