EditorCallback.cpp 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /*
  2. * EditorCallback.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 "EditorCallback.h"
  12. #include "../lib/mapping/CMap.h"
  13. #define THROW_EDITOR_UNSUPPORTED \
  14. throw std::runtime_error(std::string("EditorCallback: ") + __func__ + " is not available in map editor")
  15. VCMI_LIB_NAMESPACE_BEGIN
  16. const CMap * EditorCallback::getMapConstPtr() const
  17. {
  18. if(!map)
  19. throw std::runtime_error("EditorCallback: map pointer is null");
  20. return map;
  21. }
  22. EditorCallback::EditorCallback(const CMap * map)
  23. : map(map)
  24. {}
  25. void EditorCallback::setMap(const CMap * newMap)
  26. {
  27. map = newMap;
  28. }
  29. CGameState & EditorCallback::gameState()
  30. {
  31. THROW_EDITOR_UNSUPPORTED;
  32. }
  33. const CGameState & EditorCallback::gameState() const
  34. {
  35. THROW_EDITOR_UNSUPPORTED;
  36. }
  37. const StartInfo * EditorCallback::getStartInfo() const
  38. {
  39. THROW_EDITOR_UNSUPPORTED;
  40. }
  41. int EditorCallback::getDate(Date mode) const
  42. {
  43. THROW_EDITOR_UNSUPPORTED;
  44. }
  45. const TerrainTile * EditorCallback::getTile(int3, bool) const
  46. {
  47. THROW_EDITOR_UNSUPPORTED;
  48. }
  49. const TerrainTile * EditorCallback::getTileUnchecked(int3) const
  50. {
  51. THROW_EDITOR_UNSUPPORTED;
  52. }
  53. bool EditorCallback::isTileGuardedUnchecked(int3 tile) const
  54. {
  55. THROW_EDITOR_UNSUPPORTED;
  56. }
  57. const CGObjectInstance * EditorCallback::getTopObj(int3) const
  58. {
  59. THROW_EDITOR_UNSUPPORTED;
  60. }
  61. EDiggingStatus EditorCallback::getTileDigStatus(int3, bool) const
  62. {
  63. THROW_EDITOR_UNSUPPORTED;
  64. }
  65. void EditorCallback::calculatePaths(const std::shared_ptr<PathfinderConfig> &) const
  66. {
  67. THROW_EDITOR_UNSUPPORTED;
  68. }
  69. int3 EditorCallback::guardingCreaturePosition(int3) const
  70. {
  71. THROW_EDITOR_UNSUPPORTED;
  72. }
  73. bool EditorCallback::checkForVisitableDir(const int3 &, const int3 &) const
  74. {
  75. THROW_EDITOR_UNSUPPORTED;
  76. }
  77. std::vector<const CGObjectInstance*> EditorCallback::getGuardingCreatures(int3) const
  78. {
  79. THROW_EDITOR_UNSUPPORTED;
  80. }
  81. void EditorCallback::getTilesInRange(FowTilesType &, const int3 &, int, ETileVisibility, std::optional<PlayerColor>, int3::EDistanceFormula) const
  82. {
  83. THROW_EDITOR_UNSUPPORTED;
  84. }
  85. void EditorCallback::getAllTiles(FowTilesType &, std::optional<PlayerColor>, int, const std::function<bool(const TerrainTile *)> &) const
  86. {
  87. THROW_EDITOR_UNSUPPORTED;
  88. }
  89. std::vector<ObjectInstanceID> EditorCallback::getVisibleTeleportObjects(std::vector<ObjectInstanceID>, PlayerColor) const
  90. {
  91. THROW_EDITOR_UNSUPPORTED;
  92. }
  93. std::vector<ObjectInstanceID> EditorCallback::getTeleportChannelEntrances(TeleportChannelID, PlayerColor) const
  94. {
  95. THROW_EDITOR_UNSUPPORTED;
  96. }
  97. std::vector<ObjectInstanceID> EditorCallback::getTeleportChannelExits(TeleportChannelID, PlayerColor) const
  98. {
  99. THROW_EDITOR_UNSUPPORTED;
  100. }
  101. bool EditorCallback::isTeleportChannelImpassable(TeleportChannelID, PlayerColor) const
  102. {
  103. THROW_EDITOR_UNSUPPORTED;
  104. }
  105. bool EditorCallback::isTeleportChannelBidirectional(TeleportChannelID, PlayerColor) const
  106. {
  107. THROW_EDITOR_UNSUPPORTED;
  108. }
  109. bool EditorCallback::isTeleportChannelUnidirectional(TeleportChannelID, PlayerColor) const
  110. {
  111. THROW_EDITOR_UNSUPPORTED;
  112. }
  113. bool EditorCallback::isTeleportEntrancePassable(const CGTeleport *, PlayerColor) const
  114. {
  115. THROW_EDITOR_UNSUPPORTED;
  116. }
  117. bool EditorCallback::isVisibleFor(int3 pos, PlayerColor player) const
  118. {
  119. THROW_EDITOR_UNSUPPORTED;
  120. }
  121. bool EditorCallback::isVisibleFor(const CGObjectInstance *obj, PlayerColor player) const
  122. {
  123. THROW_EDITOR_UNSUPPORTED;
  124. }
  125. #if SCRIPTING_ENABLED
  126. scripting::Pool * EditorCallback::getGlobalContextPool() const
  127. {
  128. THROW_EDITOR_UNSUPPORTED;
  129. }
  130. #endif
  131. const TeamState * EditorCallback::getTeam(TeamID) const
  132. {
  133. THROW_EDITOR_UNSUPPORTED;
  134. }
  135. const TeamState * EditorCallback::getPlayerTeam(PlayerColor) const
  136. {
  137. THROW_EDITOR_UNSUPPORTED;
  138. }
  139. const PlayerState * EditorCallback::getPlayerState(PlayerColor, bool) const
  140. {
  141. THROW_EDITOR_UNSUPPORTED;
  142. }
  143. const PlayerSettings * EditorCallback::getPlayerSettings(PlayerColor) const
  144. {
  145. THROW_EDITOR_UNSUPPORTED;
  146. }
  147. PlayerRelations EditorCallback::getPlayerRelations(PlayerColor, PlayerColor) const
  148. {
  149. THROW_EDITOR_UNSUPPORTED;
  150. }
  151. int EditorCallback::getHeroCount(PlayerColor, bool) const
  152. {
  153. THROW_EDITOR_UNSUPPORTED;
  154. }
  155. EPlayerStatus EditorCallback::getPlayerStatus(PlayerColor, bool) const
  156. {
  157. THROW_EDITOR_UNSUPPORTED;
  158. }
  159. int EditorCallback::getResource(PlayerColor, GameResID) const
  160. {
  161. THROW_EDITOR_UNSUPPORTED;
  162. }
  163. VCMI_LIB_NAMESPACE_END