UnlockCluster.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. struct HeroPtr;
  14. class VCAI;
  15. class FuzzyHelper;
  16. namespace Goals
  17. {
  18. class DLL_EXPORT UnlockCluster : public CGoal<UnlockCluster>
  19. {
  20. private:
  21. std::shared_ptr<ObjectCluster> cluster;
  22. AIPath pathToCenter;
  23. public:
  24. UnlockCluster(std::shared_ptr<ObjectCluster> cluster, const AIPath & pathToCenter)
  25. : CGoal(Goals::UNLOCK_CLUSTER), cluster(cluster), pathToCenter(pathToCenter)
  26. {
  27. tile = cluster->blocker->visitablePos();
  28. sethero(pathToCenter.targetHero);
  29. }
  30. virtual bool operator==(const UnlockCluster & other) const override;
  31. virtual std::string toString() const override;
  32. std::shared_ptr<ObjectCluster> getCluster() const { return cluster; }
  33. const AIPath & getPathToCenter() { return pathToCenter; }
  34. };
  35. }