AIPathfinder.h 1013 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. namespace NKAI
  14. {
  15. class Nullkiller;
  16. struct PathfinderSettings
  17. {
  18. bool useHeroChain;
  19. uint8_t scoutTurnDistanceLimit;
  20. uint8_t mainTurnDistanceLimit;
  21. PathfinderSettings()
  22. :useHeroChain(false),
  23. scoutTurnDistanceLimit(255),
  24. mainTurnDistanceLimit(255)
  25. { }
  26. };
  27. class AIPathfinder
  28. {
  29. private:
  30. std::shared_ptr<AINodeStorage> storage;
  31. CPlayerSpecificInfoCallback * cb;
  32. Nullkiller * ai;
  33. public:
  34. AIPathfinder(CPlayerSpecificInfoCallback * cb, Nullkiller * ai);
  35. std::vector<AIPath> getPathInfo(const int3 & tile) const;
  36. bool isTileAccessible(const HeroPtr & hero, const int3 & tile) const;
  37. void updatePaths(std::map<const CGHeroInstance *, HeroRole> heroes, PathfinderSettings pathfinderSettings);
  38. void init();
  39. };
  40. }