ExecuteHeroChain.h 825 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * ExecuteHeroChain.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 "CGoal.h"
  12. namespace Goals
  13. {
  14. class DLL_EXPORT ExecuteHeroChain : public ElementarGoal<ExecuteHeroChain>
  15. {
  16. private:
  17. AIPath chainPath;
  18. std::string targetName;
  19. public:
  20. float closestWayRatio;
  21. ExecuteHeroChain(const AIPath & path, const CGObjectInstance * obj = nullptr);
  22. void accept(VCAI * ai) override;
  23. std::string toString() const override;
  24. virtual bool operator==(const ExecuteHeroChain & other) const override;
  25. const AIPath & getPath() const { return chainPath; }
  26. private:
  27. bool moveHeroToTile(const CGHeroInstance * hero, const int3 & tile);
  28. };
  29. }