CGameInfo.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. CServerHandler * CSH;
  15. CGameInfo::CGameInfo()
  16. {
  17. globalServices = nullptr;
  18. }
  19. void CGameInfo::setFromLib()
  20. {
  21. globalServices = VLC;
  22. modh = VLC->modh;
  23. generaltexth = VLC->generaltexth;
  24. creh = VLC->creh;
  25. townh = VLC->townh;
  26. heroh = VLC->heroh;
  27. objh = VLC->objh;
  28. spellh = VLC->spellh;
  29. skillh = VLC->skillh;
  30. objtypeh = VLC->objtypeh;
  31. terrainTypeHandler = VLC->terrainTypeHandler;
  32. battleFieldHandler = VLC->battlefieldsHandler;
  33. obstacleHandler = VLC->obstacleHandler;
  34. //TODO: biomeHandler?
  35. }
  36. const ArtifactService * CGameInfo::artifacts() const
  37. {
  38. return globalServices->artifacts();
  39. }
  40. const BattleFieldService * CGameInfo::battlefields() const
  41. {
  42. return globalServices->battlefields();
  43. }
  44. const CreatureService * CGameInfo::creatures() const
  45. {
  46. return globalServices->creatures();
  47. }
  48. const FactionService * CGameInfo::factions() const
  49. {
  50. return globalServices->factions();
  51. }
  52. const HeroClassService * CGameInfo::heroClasses() const
  53. {
  54. return globalServices->heroClasses();
  55. }
  56. const HeroTypeService * CGameInfo::heroTypes() const
  57. {
  58. return globalServices->heroTypes();
  59. }
  60. #if SCRIPTING_ENABLED
  61. const scripting::Service * CGameInfo::scripts() const
  62. {
  63. return globalServices->scripts();
  64. }
  65. #endif
  66. const spells::Service * CGameInfo::spells() const
  67. {
  68. return globalServices->spells();
  69. }
  70. const SkillService * CGameInfo::skills() const
  71. {
  72. return globalServices->skills();
  73. }
  74. const ObstacleService * CGameInfo::obstacles() const
  75. {
  76. return globalServices->obstacles();
  77. }
  78. const IGameSettings * CGameInfo::engineSettings() const
  79. {
  80. return globalServices->engineSettings();
  81. }
  82. spells::effects::Registry * CGameInfo::spellEffects()
  83. {
  84. return nullptr;
  85. }
  86. const spells::effects::Registry * CGameInfo::spellEffects() const
  87. {
  88. return globalServices->spellEffects();
  89. }