Composition.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. std::vector<TGoalVec> subtasks; // things we want to do now
  20. public:
  21. Composition()
  22. : ElementarGoal(Goals::COMPOSITION), subtasks()
  23. {
  24. }
  25. bool operator==(const Composition & other) const override;
  26. std::string toString() const override;
  27. void accept(AIGateway * ai) override;
  28. Composition & addNext(const AbstractGoal & goal);
  29. Composition & addNext(TSubgoal goal);
  30. Composition & addNextSequence(const TGoalVec & taskSequence);
  31. TGoalVec decompose(const Nullkiller * ai) const override;
  32. bool isElementar() const override;
  33. int getHeroExchangeCount() const override;
  34. std::vector<ObjectInstanceID> getAffectedObjects() const override;
  35. bool isObjectAffected(ObjectInstanceID id) const override;
  36. };
  37. }
  38. }