Invalid.h 829 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Invalid.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. namespace Goals
  17. {
  18. class DLL_EXPORT Invalid : public ElementarGoal<Invalid>
  19. {
  20. public:
  21. Invalid()
  22. : ElementarGoal(Goals::INVALID)
  23. {
  24. priority = -1;
  25. }
  26. TGoalVec decompose(const Nullkiller * ai) const override
  27. {
  28. return TGoalVec();
  29. }
  30. bool operator==(const Invalid & other) const override
  31. {
  32. return true;
  33. }
  34. std::string toString() const override
  35. {
  36. return "Invalid";
  37. }
  38. void accept(AIGateway * ai) override
  39. {
  40. throw cannotFulfillGoalException("Can not fulfill Invalid goal!");
  41. }
  42. };
  43. }
  44. }