SpecialAction.h 922 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * SpecialAction.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 "../../AIUtility.h"
  12. #include "../../Goals/AbstractGoal.h"
  13. struct AIPathNode;
  14. class SpecialAction
  15. {
  16. public:
  17. virtual ~SpecialAction() = default;
  18. virtual bool canAct(const AIPathNode * source) const
  19. {
  20. return true;
  21. }
  22. virtual Goals::TSubgoal decompose(const CGHeroInstance * hero) const;
  23. virtual void execute(const CGHeroInstance * hero) const;
  24. virtual void applyOnDestination(
  25. const CGHeroInstance * hero,
  26. CDestinationNodeInfo & destination,
  27. const PathNodeInfo & source,
  28. AIPathNode * dstMode,
  29. const AIPathNode * srcNode) const
  30. {
  31. }
  32. virtual std::string toString() const = 0;
  33. virtual const CGObjectInstance * targetObject() const { return nullptr; }
  34. };