ExchangeSwapTownHeroes.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * ExchangeSwapTownHeroes.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. #include "../Engine/Nullkiller.h"
  13. namespace NKAI
  14. {
  15. namespace Goals
  16. {
  17. class DLL_EXPORT ExchangeSwapTownHeroes : public ElementarGoal<ExchangeSwapTownHeroes>
  18. {
  19. private:
  20. const CGTownInstance * town;
  21. const CGHeroInstance * garrisonHero;
  22. HeroLockedReason lockingReason;
  23. public:
  24. ExchangeSwapTownHeroes(
  25. const CGTownInstance * town,
  26. const CGHeroInstance * garrisonHero = nullptr,
  27. HeroLockedReason lockingReason = HeroLockedReason::NOT_LOCKED);
  28. void accept(AIGateway * ai) override;
  29. std::string toString() const override;
  30. virtual bool operator==(const ExchangeSwapTownHeroes & other) const override;
  31. const CGHeroInstance * getGarrisonHero() const { return garrisonHero; }
  32. HeroLockedReason getLockingReason() const { return lockingReason; }
  33. };
  34. }
  35. }