SpecialAction.h 883 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 bool canAct(const AIPathNode * source) const
  18. {
  19. return true;
  20. }
  21. virtual Goals::TSubgoal decompose(const CGHeroInstance * hero) const;
  22. virtual void execute(const CGHeroInstance * hero) const;
  23. virtual void applyOnDestination(
  24. const CGHeroInstance * hero,
  25. CDestinationNodeInfo & destination,
  26. const PathNodeInfo & source,
  27. AIPathNode * dstMode,
  28. const AIPathNode * srcNode) const
  29. {
  30. }
  31. virtual std::string toString() const = 0;
  32. virtual const CGObjectInstance * targetObject() const { return nullptr; }
  33. };