ExecuteHeroChain.h 866 B

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