ExecuteHeroChain.h 980 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 NKAI
  14. {
  15. namespace Goals
  16. {
  17. class DLL_EXPORT ExecuteHeroChain : public ElementarGoal<ExecuteHeroChain>
  18. {
  19. private:
  20. AIPath chainPath;
  21. std::string targetName;
  22. public:
  23. float closestWayRatio;
  24. ExecuteHeroChain(const AIPath & path, const CGObjectInstance * obj = nullptr);
  25. void accept(AIGateway * ai) override;
  26. std::string toString() const override;
  27. virtual bool operator==(const ExecuteHeroChain & other) const override;
  28. const AIPath & getPath() const { return chainPath; }
  29. virtual int getHeroExchangeCount() const override { return chainPath.exchangeCount; }
  30. private:
  31. bool moveHeroToTile(const CGHeroInstance * hero, const int3 & tile);
  32. };
  33. }
  34. }