Composition.h 893 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 Goals
  13. {
  14. class DLL_EXPORT Composition : public ElementarGoal<Composition>
  15. {
  16. private:
  17. TGoalVec subtasks;
  18. public:
  19. Composition()
  20. : ElementarGoal(Goals::COMPOSITION), subtasks()
  21. {
  22. }
  23. Composition(TGoalVec subtasks)
  24. : ElementarGoal(Goals::COMPOSITION), subtasks(subtasks)
  25. {
  26. }
  27. virtual bool operator==(const Composition & other) const override;
  28. virtual std::string toString() const override;
  29. void accept(VCAI * ai) override;
  30. Composition & addNext(AbstractGoal & goal);
  31. Composition & addNext(TSubgoal goal);
  32. virtual TGoalVec decompose() const override;
  33. virtual bool isElementar() const override;
  34. };
  35. }