Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
/*
|
|
|
|
|
* mock_IGameInfoCallback.h, part of VCMI engine
|
|
|
|
|
*
|
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
|
*
|
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2025-05-11 11:58:09 +03:00
|
|
|
#include "../../lib/callback/CGameInfoCallback.h"
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
|
2025-05-15 13:04:47 +03:00
|
|
|
#if SCRIPTING_ENABLED
|
|
|
|
|
#include <vcmi/scripting/Service.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
class IGameInfoCallbackMock : public IGameInfoCallback
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
//various
|
2023-08-19 22:35:44 +03:00
|
|
|
MOCK_CONST_METHOD1(getDate, int(Date));
|
2025-03-03 14:46:15 +00:00
|
|
|
MOCK_CONST_METHOD0(getStartInfo, const StartInfo *());
|
2025-05-15 13:04:47 +03:00
|
|
|
MOCK_CONST_METHOD0(getMapHeader, const CMapHeader *());
|
|
|
|
|
MOCK_CONST_METHOD0(getMapSize, int3());
|
2025-03-03 14:46:15 +00:00
|
|
|
MOCK_CONST_METHOD0(getInitialStartInfo, const StartInfo *());
|
2023-11-08 18:50:37 +02:00
|
|
|
|
|
|
|
|
MOCK_CONST_METHOD1(isAllowed, bool(SpellID));
|
|
|
|
|
MOCK_CONST_METHOD1(isAllowed, bool(ArtifactID));
|
|
|
|
|
MOCK_CONST_METHOD1(isAllowed, bool(SecondarySkill));
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
|
|
|
|
|
//player
|
|
|
|
|
MOCK_CONST_METHOD1(getPlayer, const Player *(PlayerColor));
|
|
|
|
|
MOCK_CONST_METHOD0(getLocalPlayer, PlayerColor());
|
2023-08-31 23:36:39 +03:00
|
|
|
MOCK_CONST_METHOD0(getPlayerID, std::optional<PlayerColor>());
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
|
|
|
|
|
//hero
|
|
|
|
|
MOCK_CONST_METHOD1(getHero, const CGHeroInstance *(ObjectInstanceID));
|
|
|
|
|
MOCK_CONST_METHOD1(getHeroWithSubid, const CGHeroInstance *(int));
|
|
|
|
|
|
|
|
|
|
//objects
|
|
|
|
|
MOCK_CONST_METHOD2(getObj, const CGObjectInstance *(ObjectInstanceID, bool));
|
|
|
|
|
MOCK_CONST_METHOD2(getVisitableObjs, std::vector<const CGObjectInstance*>(int3, bool));
|
|
|
|
|
|
2025-05-15 13:04:47 +03:00
|
|
|
CGameState & gameState() { throw std::runtime_error("not implemented");}
|
|
|
|
|
const CGameState & gameState() const { throw std::runtime_error("not implemented");}
|
|
|
|
|
const IGameSettings & getSettings() const { throw std::runtime_error("not implemented");}
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
|
2025-05-15 13:04:47 +03:00
|
|
|
MOCK_CONST_METHOD2(isVisibleFor, bool(int3 pos, PlayerColor player));
|
|
|
|
|
MOCK_CONST_METHOD2(isVisibleFor, bool(const CGObjectInstance * obj, PlayerColor player));
|
|
|
|
|
MOCK_CONST_METHOD1(isInTheMap, bool(const int3 & pos));
|
|
|
|
|
MOCK_CONST_METHOD1(getTeam, const TeamState *(TeamID teamID));
|
|
|
|
|
MOCK_CONST_METHOD1(getPlayerTeam, const TeamState *(PlayerColor color));
|
|
|
|
|
MOCK_CONST_METHOD2(getPlayerState, const PlayerState *(PlayerColor color, bool verbose));
|
|
|
|
|
MOCK_CONST_METHOD1(getPlayerSettings, const PlayerSettings *(PlayerColor color));
|
|
|
|
|
MOCK_CONST_METHOD2(getPlayerRelations, PlayerRelations(PlayerColor color1, PlayerColor color2));
|
|
|
|
|
MOCK_CONST_METHOD2(getHeroCount, int(PlayerColor player, bool includeGarrisoned));
|
|
|
|
|
MOCK_CONST_METHOD2(getPlayerStatus, EPlayerStatus(PlayerColor player, bool verbose));
|
|
|
|
|
MOCK_CONST_METHOD2(getResource, int(PlayerColor Player, GameResID which));
|
|
|
|
|
MOCK_CONST_METHOD1(getTown, const CGTownInstance *(ObjectInstanceID objid));
|
|
|
|
|
MOCK_CONST_METHOD1(getObjInstance, const CGObjectInstance *(ObjectInstanceID oid));
|
|
|
|
|
MOCK_CONST_METHOD1(getArtInstance, const CArtifactInstance *(ArtifactInstanceID aid));
|
|
|
|
|
MOCK_CONST_METHOD2(getTile, const TerrainTile *(int3 tile, bool verbose));
|
|
|
|
|
MOCK_CONST_METHOD1(getTileUnchecked, const TerrainTile *(int3 tile));
|
|
|
|
|
MOCK_CONST_METHOD1(getTopObj, const CGObjectInstance *(int3 pos));
|
|
|
|
|
MOCK_CONST_METHOD2(getTileDigStatus, EDiggingStatus(int3 tile, bool verbose));
|
|
|
|
|
MOCK_CONST_METHOD1(calculatePaths, void(const std::shared_ptr<PathfinderConfig> & config));
|
|
|
|
|
MOCK_CONST_METHOD6(getTilesInRange, void( std::unordered_set<int3> & tiles, const int3 & pos, int radius, ETileVisibility mode, std::optional<PlayerColor> player, int3::EDistanceFormula formula));
|
|
|
|
|
MOCK_CONST_METHOD4(getAllTiles, void(std::unordered_set<int3> & tiles, std::optional<PlayerColor> player, int level, std::function<bool(const TerrainTile *)> filter));
|
|
|
|
|
MOCK_CONST_METHOD2(getVisibleTeleportObjects, std::vector<ObjectInstanceID>(std::vector<ObjectInstanceID> ids, PlayerColor player));
|
|
|
|
|
MOCK_CONST_METHOD2(getTeleportChannelEntrances, std::vector<ObjectInstanceID>(TeleportChannelID id, PlayerColor Player));
|
|
|
|
|
MOCK_CONST_METHOD2(getTeleportChannelExits, std::vector<ObjectInstanceID>(TeleportChannelID id, PlayerColor Player));
|
|
|
|
|
MOCK_CONST_METHOD2(isTeleportChannelImpassable, bool(TeleportChannelID id, PlayerColor player));
|
|
|
|
|
MOCK_CONST_METHOD2(isTeleportChannelBidirectional, bool(TeleportChannelID id, PlayerColor player));
|
|
|
|
|
MOCK_CONST_METHOD2(isTeleportChannelUnidirectional, bool(TeleportChannelID id, PlayerColor player));
|
|
|
|
|
MOCK_CONST_METHOD2(isTeleportEntrancePassable, bool(const CGTeleport * obj, PlayerColor player));
|
|
|
|
|
MOCK_METHOD2(pickAllowedArtsSet, void(std::vector<ArtifactID> & out, vstd::RNG & rand));
|
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2018-03-17 17:58:30 +03:00
|
|
|
|
2025-05-15 13:04:47 +03:00
|
|
|
#if SCRIPTING_ENABLED
|
|
|
|
|
MOCK_CONST_METHOD0(getGlobalContextPool, scripting::Pool *());
|
|
|
|
|
#endif
|
|
|
|
|
};
|