CaptureObject.h 889 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * CaptureObject.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 NKAI
  13. {
  14. struct HeroPtr;
  15. class AIGateway;
  16. class FuzzyHelper;
  17. namespace Goals
  18. {
  19. class DLL_EXPORT CaptureObject : public CGoal<CaptureObject>
  20. {
  21. private:
  22. std::string name;
  23. public:
  24. CaptureObject(const CGObjectInstance * obj)
  25. : CGoal(Goals::CAPTURE_OBJECT)
  26. {
  27. objid = obj->id.getNum();
  28. tile = obj->visitablePos();
  29. name = obj->typeName;
  30. }
  31. bool operator==(const CaptureObject & other) const override;
  32. Goals::TGoalVec decompose(const Nullkiller * ai) const override;
  33. std::string toString() const override;
  34. bool hasHash() const override { return true; }
  35. uint64_t getHash() const override;
  36. };
  37. }
  38. }