Composition.h 977 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * BuildThis.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 Composition : public ElementarGoal<Composition>
  17. {
  18. private:
  19. TGoalVec subtasks;
  20. public:
  21. Composition()
  22. : ElementarGoal(Goals::COMPOSITION), subtasks()
  23. {
  24. }
  25. Composition(TGoalVec subtasks)
  26. : ElementarGoal(Goals::COMPOSITION), subtasks(subtasks)
  27. {
  28. }
  29. virtual bool operator==(const Composition & other) const override;
  30. virtual std::string toString() const override;
  31. void accept(AIGateway * ai) override;
  32. Composition & addNext(const AbstractGoal & goal);
  33. Composition & addNext(TSubgoal goal);
  34. virtual TGoalVec decompose() const override;
  35. virtual bool isElementar() const override;
  36. virtual int getHeroExchangeCount() const override;
  37. };
  38. }
  39. }