mock_IGameEventCallback.h 6.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * mock_IGameEventCallback.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 <vcmi/ServerCallback.h>
  12. #include "../../lib/callback/IGameEventCallback.h"
  13. #include "../../lib/int3.h"
  14. #include "../../lib/ResourceSet.h"
  15. class GameEventCallbackMock : public IGameEventCallback
  16. {
  17. public:
  18. using UpperCallback = ::ServerCallback;
  19. GameEventCallbackMock(UpperCallback * upperCallback_);
  20. virtual ~GameEventCallbackMock();
  21. void setObjPropertyValue(ObjectInstanceID objid, ObjProperty prop, int32_t value) override {}
  22. void setObjPropertyID(ObjectInstanceID objid, ObjProperty prop, ObjPropertyID identifier) override {}
  23. void setRewardableObjectConfiguration(ObjectInstanceID mapObjectID, const Rewardable::Configuration & configuration) override {}
  24. void setRewardableObjectConfiguration(ObjectInstanceID townInstanceID, BuildingID buildingID, const Rewardable::Configuration & configuration) override {}
  25. void showInfoDialog(InfoWindow * iw) override {}
  26. void changeSpells(const CGHeroInstance * hero, bool give, const std::set<SpellID> &spells) override {}
  27. void setResearchedSpells(const CGTownInstance * town, int level, const std::vector<SpellID> & spells, bool accepted) override {}
  28. bool removeObject(const CGObjectInstance * obj, const PlayerColor & initiator) override {return false;}
  29. void createBoat(const int3 & visitablePosition, BoatId type, PlayerColor initiator) override {}
  30. void setOwner(const CGObjectInstance * objid, PlayerColor owner) override {}
  31. void giveExperience(const CGHeroInstance * hero, TExpType val) override {}
  32. void changePrimSkill(const CGHeroInstance * hero, PrimarySkill which, si64 val, ChangeValueMode mode) override {}
  33. void changeSecSkill(const CGHeroInstance * hero, SecondarySkill which, int val, ChangeValueMode mode) override {}
  34. void showBlockingDialog(const IObjectInterface * caller, BlockingDialog *iw) override {}
  35. void showGarrisonDialog(ObjectInstanceID upobj, ObjectInstanceID hid, bool removableUnits) override {} //cb will be called when player closes garrison window
  36. void showTeleportDialog(TeleportDialog *iw) override {}
  37. void showObjectWindow(const CGObjectInstance * object, EOpenWindowMode window, const CGHeroInstance * visitor, bool addQuery) override {};
  38. void giveResource(PlayerColor player, GameResID which, int val) override {}
  39. void giveResources(PlayerColor player, const ResourceSet & resources) override {}
  40. void giveCreatures(const CGHeroInstance * h, const CCreatureSet &creatures) override{}
  41. void giveCreatures(const CArmedInstance *objid, const CGHeroInstance * h, const CCreatureSet &creatures, bool remove) override {}
  42. void takeCreatures(ObjectInstanceID objid, const std::vector<CStackBasicDescriptor> &creatures, bool forceRemoval) override {}
  43. bool changeStackCount(const StackLocation &sl, TQuantity count, ChangeValueMode mode) override {return false;}
  44. bool changeStackType(const StackLocation &sl, const CCreature *c) override {return false;}
  45. bool insertNewStack(const StackLocation &sl, const CCreature *c, TQuantity count) override {return false;} //count -1 => moves whole stack
  46. bool eraseStack(const StackLocation &sl, bool forceRemoval) override {return false;}
  47. bool swapStacks(const StackLocation &sl1, const StackLocation &sl2) override {return false;}
  48. bool addToSlot(const StackLocation &sl, const CCreature *c, TQuantity count) override {return false;} //makes new stack or increases count of already existing
  49. void tryJoiningArmy(const CArmedInstance *src, const CArmedInstance *dst, bool removeObjWhenFinished, bool allowMerging) override {} //merges army from src do dst or opens a garrison window
  50. bool moveStack(const StackLocation &src, const StackLocation &dst, TQuantity count) override {return false;}
  51. void removeAfterVisit(const ObjectInstanceID & id) override {} //object will be destroyed when interaction is over. Do not call when interaction is not ongoing!
  52. bool giveHeroNewArtifact(const CGHeroInstance * h, const ArtifactID & artId, const ArtifactPosition & pos) override {return false;}
  53. bool giveHeroNewScroll(const CGHeroInstance * h, const SpellID & spellId, const ArtifactPosition & pos) override {return false;}
  54. bool putArtifact(const ArtifactLocation & al, const ArtifactInstanceID & id, std::optional<bool> askAssemble) override {return false;}
  55. void removeArtifact(const ArtifactLocation &al) override {}
  56. bool moveArtifact(const PlayerColor & player, const ArtifactLocation & al1, const ArtifactLocation & al2) override {return false;}
  57. void heroVisitCastle(const CGTownInstance * obj, const CGHeroInstance * hero) override {}
  58. void stopHeroVisitCastle(const CGTownInstance * obj, const CGHeroInstance * hero) override {}
  59. void visitCastleObjects(const CGTownInstance * obj, const CGHeroInstance * hero) override {}
  60. void startBattle(const CArmedInstance *army1, const CArmedInstance *army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, const BattleLayout & layout, const CGTownInstance *town) override {} //use hero=nullptr for no hero
  61. void startBattle(const CArmedInstance *army1, const CArmedInstance *army2) override {}
  62. bool moveHero(ObjectInstanceID hid, int3 dst, EMovementMode movementMode, bool transit, PlayerColor asker) override {return false;}
  63. void giveHeroBonus(GiveBonus * bonus) override {}
  64. void setMovePoints(SetMovePoints * smp) override {}
  65. void setMovePoints(ObjectInstanceID hid, int val) override {};
  66. void setManaPoints(ObjectInstanceID hid, int val) override {}
  67. void giveHero(ObjectInstanceID id, PlayerColor player, ObjectInstanceID boatId) override {}
  68. void changeObjPos(ObjectInstanceID objid, int3 newPos, const PlayerColor & initiator) override {}
  69. void heroExchange(ObjectInstanceID hero1, ObjectInstanceID hero2) override {} //when two heroes meet on adventure map
  70. void changeFogOfWar(int3 center, ui32 radius, PlayerColor player, ETileVisibility mode) override {}
  71. void changeFogOfWar(const FowTilesType &tiles, PlayerColor player, ETileVisibility mode) override {}
  72. void castSpell(const spells::Caster * caster, SpellID spellID, const int3 &pos) override {}
  73. ///useful callback methods
  74. void sendAndApply(CPackForClient & pack) override;
  75. bool isVisitCoveredByAnotherQuery(const CGObjectInstance *obj, const CGHeroInstance *hero) override {return false;}
  76. vstd::RNG & getRandomGenerator() override;
  77. private:
  78. UpperCallback * upperCallback;
  79. };