CompleteQuest.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * CompleteQuestBehavior.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 "../AIUtility.h"
  12. #include "../Goals/CGoal.h"
  13. #include "../../../lib/gameState/QuestInfo.h"
  14. namespace NK2AI
  15. {
  16. namespace Goals
  17. {
  18. class CompleteQuest : public CGoal<CompleteQuest>
  19. {
  20. QuestInfo q;
  21. CCallback & cc;
  22. public:
  23. CompleteQuest(const QuestInfo & quest, CCallback & cc) : CGoal(COMPLETE_QUEST), q(quest), cc(cc) {}
  24. Goals::TGoalVec decompose(const Nullkiller * aiNk) const override;
  25. std::string toString() const override;
  26. bool hasHash() const override { return true; }
  27. uint64_t getHash() const override;
  28. bool operator==(const CompleteQuest & other) const override;
  29. private:
  30. TGoalVec tryCompleteQuest(const Nullkiller * aiNk) const;
  31. TGoalVec missionArt(const Nullkiller * aiNk) const;
  32. TGoalVec missionHero(const Nullkiller * aiNk) const;
  33. TGoalVec missionArmy(const Nullkiller * aiNk) const;
  34. TGoalVec missionResources(const Nullkiller * aiNk) const;
  35. TGoalVec missionDestroyObj(const Nullkiller * aiNk) const;
  36. TGoalVec missionIncreasePrimaryStat(const Nullkiller * aiNk) const;
  37. TGoalVec missionLevel(const Nullkiller * aiNk) const;
  38. TGoalVec missionKeymaster(const Nullkiller * aiNk) const;
  39. std::string questToString() const;
  40. };
  41. }
  42. }