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