AIPathfinder.h 929 B

123456789101112131415161718192021222324252627282930313233
  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. #include "../VCAI.h"
  14. class AIPathfinder
  15. {
  16. private:
  17. static std::vector<std::shared_ptr<AINodeStorage>> storagePool;
  18. static std::map<HeroPtr, std::shared_ptr<AINodeStorage>> storageMap;
  19. CPlayerSpecificInfoCallback * cb;
  20. VCAI * ai;
  21. std::shared_ptr<const AINodeStorage> getStorage(const HeroPtr & hero) const;
  22. public:
  23. AIPathfinder(CPlayerSpecificInfoCallback * cb, VCAI * ai);
  24. std::vector<AIPath> getPathInfo(const HeroPtr & hero, const int3 & tile) const;
  25. bool isTileAccessible(const HeroPtr & hero, const int3 & tile) const;
  26. void updatePaths(std::vector<HeroPtr> heroes);
  27. void updatePaths(const HeroPtr & heroes);
  28. void init();
  29. };