AdventureSpellCast.h 809 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * AdventureSpellCast.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. namespace Goals
  15. {
  16. class DLL_EXPORT AdventureSpellCast : public ElementarGoal<AdventureSpellCast>
  17. {
  18. private:
  19. SpellID spellID;
  20. public:
  21. AdventureSpellCast(const CGHeroInstance * hero, SpellID spellID)
  22. : ElementarGoal(Goals::ADVENTURE_SPELL_CAST), spellID(spellID)
  23. {
  24. sethero(hero);
  25. }
  26. const CSpell * getSpell() const
  27. {
  28. return spellID.toSpell();
  29. }
  30. void accept(AIGateway * ai) override;
  31. std::string toString() const override;
  32. bool operator==(const AdventureSpellCast & other) const override;
  33. };
  34. }
  35. }