UnlockCluster.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * FindObj.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 "../Goals/CGoal.h"
  12. #include "../Analyzers/ObjectClusterizer.h"
  13. namespace NKAI
  14. {
  15. struct HeroPtr;
  16. class AIGateway;
  17. class FuzzyHelper;
  18. namespace Goals
  19. {
  20. class DLL_EXPORT UnlockCluster : public CGoal<UnlockCluster>
  21. {
  22. private:
  23. std::shared_ptr<ObjectCluster> cluster;
  24. AIPath pathToCenter;
  25. public:
  26. UnlockCluster(std::shared_ptr<ObjectCluster> cluster, const AIPath & pathToCenter)
  27. : CGoal(Goals::UNLOCK_CLUSTER), cluster(cluster), pathToCenter(pathToCenter)
  28. {
  29. tile = cluster->blocker->visitablePos();
  30. hero = pathToCenter.targetHero;
  31. }
  32. bool operator==(const UnlockCluster & other) const override;
  33. std::string toString() const override;
  34. std::shared_ptr<ObjectCluster> getCluster() const { return cluster; }
  35. const AIPath & getPathToCenter() { return pathToCenter; }
  36. };
  37. }
  38. }