IMapRendererObserver.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * IMapRendererObserver.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. VCMI_LIB_NAMESPACE_BEGIN
  12. class int3;
  13. class CGObjectInstance;
  14. class CGHeroInstance;
  15. class PlayerColor;
  16. VCMI_LIB_NAMESPACE_END
  17. class IMapObjectObserver
  18. {
  19. public:
  20. IMapObjectObserver();
  21. virtual ~IMapObjectObserver();
  22. virtual bool hasOngoingAnimations() = 0;
  23. virtual void waitForOngoingAnimations(){};
  24. virtual void endNetwork(){};
  25. /// Plays fade-in animation and adds object to map
  26. virtual void onObjectFadeIn(const CGObjectInstance * obj, const PlayerColor & initiator) = 0;
  27. /// Plays fade-out animation and removed object from map
  28. virtual void onObjectFadeOut(const CGObjectInstance * obj, const PlayerColor & initiator) = 0;
  29. /// Adds object to map instantly, with no animation
  30. virtual void onObjectInstantAdd(const CGObjectInstance * obj, const PlayerColor & initiator) = 0;
  31. /// Removes object from map instantly, with no animation
  32. virtual void onObjectInstantRemove(const CGObjectInstance * obj, const PlayerColor & initiator) = 0;
  33. /// Perform hero movement animation, moving hero across terrain
  34. virtual void onHeroMoved(const CGHeroInstance * obj, const int3 & from, const int3 & dest) = 0;
  35. /// Perform initialization of hero teleportation animation with terrain fade animation
  36. virtual void onBeforeHeroTeleported(const CGHeroInstance * obj, const int3 & from, const int3 & dest) = 0;
  37. virtual void onAfterHeroTeleported(const CGHeroInstance * obj, const int3 & from, const int3 & dest) = 0;
  38. virtual void onBeforeHeroEmbark(const CGHeroInstance * obj, const int3 & from, const int3 & dest) = 0;
  39. virtual void onAfterHeroEmbark(const CGHeroInstance * obj, const int3 & from, const int3 & dest) = 0;
  40. virtual void onBeforeHeroDisembark(const CGHeroInstance * obj, const int3 & from, const int3 & dest) = 0;
  41. virtual void onAfterHeroDisembark(const CGHeroInstance * obj, const int3 & from, const int3 & dest) = 0;
  42. };