AIPathfinder.h 930 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * AIPathfinder.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 "AINodeStorage.h"
  12. #include "../AIUtility.h"
  13. class Nullkiller;
  14. struct PathfinderSettings
  15. {
  16. bool useHeroChain;
  17. uint8_t scoutTurnDistanceLimit;
  18. PathfinderSettings()
  19. :useHeroChain(false),
  20. scoutTurnDistanceLimit(255)
  21. { }
  22. };
  23. class AIPathfinder
  24. {
  25. private:
  26. std::shared_ptr<AINodeStorage> storage;
  27. CPlayerSpecificInfoCallback * cb;
  28. Nullkiller * ai;
  29. public:
  30. AIPathfinder(CPlayerSpecificInfoCallback * cb, Nullkiller * ai);
  31. std::vector<AIPath> getPathInfo(const int3 & tile) const;
  32. bool isTileAccessible(const HeroPtr & hero, const int3 & tile) const;
  33. void updatePaths(std::map<const CGHeroInstance *, HeroRole> heroes, PathfinderSettings pathfinderSettings);
  34. void init();
  35. };