BuildThis.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. #include "../Analyzers/BuildAnalyzer.h"
  13. struct HeroPtr;
  14. class VCAI;
  15. class FuzzyHelper;
  16. namespace Goals
  17. {
  18. class DLL_EXPORT BuildThis : public ElementarGoal<BuildThis>
  19. {
  20. public:
  21. BuildingInfo buildingInfo;
  22. TownDevelopmentInfo townInfo;
  23. BuildThis() //should be private, but unit test uses it
  24. : ElementarGoal(Goals::BUILD_STRUCTURE)
  25. {
  26. }
  27. BuildThis(const BuildingInfo & buildingInfo, const TownDevelopmentInfo & townInfo) //should be private, but unit test uses it
  28. : ElementarGoal(Goals::BUILD_STRUCTURE), buildingInfo(buildingInfo), townInfo(townInfo)
  29. {
  30. bid = buildingInfo.id;
  31. town = townInfo.town;
  32. }
  33. BuildThis(BuildingID Bid, const CGTownInstance * tid)
  34. : ElementarGoal(Goals::BUILD_STRUCTURE)
  35. {
  36. bid = Bid;
  37. town = tid;
  38. priority = 1;
  39. }
  40. BuildThis(BuildingID Bid)
  41. : ElementarGoal(Goals::BUILD_STRUCTURE)
  42. {
  43. bid = Bid;
  44. priority = 1;
  45. }
  46. virtual bool operator==(const BuildThis & other) const override;
  47. virtual std::string toString() const override;
  48. void accept(VCAI * ai) override;
  49. };
  50. }