AIPathfinder.h 992 B

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