RecruitHero.h 1018 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * RecruitHero.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 RecruitHero : public ElementarGoal<RecruitHero>
  20. {
  21. private:
  22. const CGHeroInstance * heroToBuy;
  23. public:
  24. RecruitHero(const CGTownInstance * townWithTavern, const CGHeroInstance * heroToBuy)
  25. : ElementarGoal(Goals::RECRUIT_HERO), heroToBuy(heroToBuy)
  26. {
  27. town = townWithTavern;
  28. priority = 1;
  29. }
  30. RecruitHero(const CGTownInstance * townWithTavern)
  31. : RecruitHero(townWithTavern, nullptr)
  32. {
  33. }
  34. bool operator==(const RecruitHero & other) const override
  35. {
  36. return true;
  37. }
  38. std::string toString() const override;
  39. const CGHeroInstance* getHero() const override { return heroToBuy; }
  40. void accept(AIGateway * ai) override;
  41. };
  42. }
  43. }