mock_IGameInfoCallback.h 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * mock_IGameInfoCallback.h, 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. #pragma once
  11. #include "../../lib/callback/CGameInfoCallback.h"
  12. #if SCRIPTING_ENABLED
  13. #include <vcmi/scripting/Service.h>
  14. #endif
  15. class IGameInfoCallbackMock : public IGameInfoCallback
  16. {
  17. public:
  18. //various
  19. MOCK_CONST_METHOD1(getDate, int(Date));
  20. MOCK_CONST_METHOD0(getStartInfo, const StartInfo *());
  21. MOCK_CONST_METHOD0(getMapHeader, const CMapHeader *());
  22. MOCK_CONST_METHOD0(getMapSize, int3());
  23. MOCK_CONST_METHOD0(getInitialStartInfo, const StartInfo *());
  24. MOCK_CONST_METHOD1(isAllowed, bool(SpellID));
  25. MOCK_CONST_METHOD1(isAllowed, bool(ArtifactID));
  26. MOCK_CONST_METHOD1(isAllowed, bool(SecondarySkill));
  27. //player
  28. MOCK_CONST_METHOD1(getPlayer, const Player *(PlayerColor));
  29. MOCK_CONST_METHOD0(getLocalPlayer, PlayerColor());
  30. MOCK_CONST_METHOD0(getPlayerID, std::optional<PlayerColor>());
  31. //hero
  32. MOCK_CONST_METHOD1(getHero, const CGHeroInstance *(ObjectInstanceID));
  33. MOCK_CONST_METHOD1(getHeroWithSubid, const CGHeroInstance *(int));
  34. //objects
  35. MOCK_CONST_METHOD2(getObj, const CGObjectInstance *(ObjectInstanceID, bool));
  36. MOCK_CONST_METHOD2(getVisitableObjs, std::vector<const CGObjectInstance*>(int3, bool));
  37. CGameState & gameState() { throw std::runtime_error("not implemented");}
  38. const CGameState & gameState() const { throw std::runtime_error("not implemented");}
  39. const IGameSettings & getSettings() const { throw std::runtime_error("not implemented");}
  40. MOCK_CONST_METHOD2(isVisibleFor, bool(int3 pos, PlayerColor player));
  41. MOCK_CONST_METHOD2(isVisibleFor, bool(const CGObjectInstance * obj, PlayerColor player));
  42. MOCK_CONST_METHOD1(isInTheMap, bool(const int3 & pos));
  43. MOCK_CONST_METHOD1(getTeam, const TeamState *(TeamID teamID));
  44. MOCK_CONST_METHOD1(getPlayerTeam, const TeamState *(PlayerColor color));
  45. MOCK_CONST_METHOD2(getPlayerState, const PlayerState *(PlayerColor color, bool verbose));
  46. MOCK_CONST_METHOD1(getPlayerSettings, const PlayerSettings *(PlayerColor color));
  47. MOCK_CONST_METHOD2(getPlayerRelations, PlayerRelations(PlayerColor color1, PlayerColor color2));
  48. MOCK_CONST_METHOD2(getHeroCount, int(PlayerColor player, bool includeGarrisoned));
  49. MOCK_CONST_METHOD2(getPlayerStatus, EPlayerStatus(PlayerColor player, bool verbose));
  50. MOCK_CONST_METHOD2(getResource, int(PlayerColor Player, GameResID which));
  51. MOCK_CONST_METHOD1(getTown, const CGTownInstance *(ObjectInstanceID objid));
  52. MOCK_CONST_METHOD1(getObjInstance, const CGObjectInstance *(ObjectInstanceID oid));
  53. MOCK_CONST_METHOD1(getArtInstance, const CArtifactInstance *(ArtifactInstanceID aid));
  54. MOCK_CONST_METHOD2(getTile, const TerrainTile *(int3 tile, bool verbose));
  55. MOCK_CONST_METHOD1(getTileUnchecked, const TerrainTile *(int3 tile));
  56. MOCK_CONST_METHOD1(getTopObj, const CGObjectInstance *(int3 pos));
  57. MOCK_CONST_METHOD2(getTileDigStatus, EDiggingStatus(int3 tile, bool verbose));
  58. MOCK_CONST_METHOD1(calculatePaths, void(const std::shared_ptr<PathfinderConfig> & config));
  59. MOCK_CONST_METHOD6(getTilesInRange, void(FowTilesType & tiles, const int3 & pos, int radius, ETileVisibility mode, std::optional<PlayerColor> player, int3::EDistanceFormula formula));
  60. MOCK_CONST_METHOD4(getAllTiles, void(FowTilesType & tiles, std::optional<PlayerColor> player, int level, const std::function<bool(const TerrainTile *)> & filter));
  61. MOCK_CONST_METHOD2(getVisibleTeleportObjects, std::vector<ObjectInstanceID>(std::vector<ObjectInstanceID> ids, PlayerColor player));
  62. MOCK_CONST_METHOD2(getTeleportChannelEntrances, std::vector<ObjectInstanceID>(TeleportChannelID id, PlayerColor Player));
  63. MOCK_CONST_METHOD2(getTeleportChannelExits, std::vector<ObjectInstanceID>(TeleportChannelID id, PlayerColor Player));
  64. MOCK_CONST_METHOD2(isTeleportChannelImpassable, bool(TeleportChannelID id, PlayerColor player));
  65. MOCK_CONST_METHOD2(isTeleportChannelBidirectional, bool(TeleportChannelID id, PlayerColor player));
  66. MOCK_CONST_METHOD2(isTeleportChannelUnidirectional, bool(TeleportChannelID id, PlayerColor player));
  67. MOCK_CONST_METHOD2(isTeleportEntrancePassable, bool(const CGTeleport * obj, PlayerColor player));
  68. MOCK_CONST_METHOD1(guardingCreaturePosition, int3(int3 pos));
  69. MOCK_CONST_METHOD2(checkForVisitableDir, bool(const int3 & src, const int3 & dst));
  70. MOCK_CONST_METHOD1(getGuardingCreatures, std::vector<const CGObjectInstance *>(int3 pos));
  71. MOCK_CONST_METHOD1(isTileGuardedUnchecked, bool(int3 pos));
  72. MOCK_METHOD2(pickAllowedArtsSet, void(std::vector<ArtifactID> & out, vstd::RNG & rand));
  73. #if SCRIPTING_ENABLED
  74. MOCK_CONST_METHOD0(getGlobalContextPool, scripting::Pool *());
  75. #endif
  76. };