CGameInfo.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. CGameInfo * CGI;
  14. CClientState * CCS = nullptr;
  15. CServerHandler * CSH;
  16. CGameInfo::CGameInfo()
  17. {
  18. globalServices = nullptr;
  19. }
  20. void CGameInfo::setFromLib()
  21. {
  22. globalServices = VLC;
  23. modh = VLC->modh;
  24. generaltexth = VLC->generaltexth;
  25. creh = VLC->creh;
  26. townh = VLC->townh;
  27. heroh = VLC->heroh;
  28. objh = VLC->objh;
  29. spellh = VLC->spellh;
  30. skillh = VLC->skillh;
  31. objtypeh = VLC->objtypeh;
  32. terrainTypeHandler = VLC->terrainTypeHandler;
  33. battleFieldHandler = VLC->battlefieldsHandler;
  34. obstacleHandler = VLC->obstacleHandler;
  35. //TODO: biomeHandler?
  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. #if SCRIPTING_ENABLED
  62. const scripting::Service * CGameInfo::scripts() const
  63. {
  64. return globalServices->scripts();
  65. }
  66. #endif
  67. const spells::Service * CGameInfo::spells() const
  68. {
  69. return globalServices->spells();
  70. }
  71. const SkillService * CGameInfo::skills() const
  72. {
  73. return globalServices->skills();
  74. }
  75. const ObstacleService * CGameInfo::obstacles() const
  76. {
  77. return globalServices->obstacles();
  78. }
  79. const IGameSettings * CGameInfo::engineSettings() const
  80. {
  81. return globalServices->engineSettings();
  82. }
  83. spells::effects::Registry * CGameInfo::spellEffects()
  84. {
  85. return nullptr;
  86. }
  87. const spells::effects::Registry * CGameInfo::spellEffects() const
  88. {
  89. return globalServices->spellEffects();
  90. }