AIPathfinder.h 818 B

1234567891011121314151617181920212223242526272829303132
  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. static boost::mutex storageMutex;
  20. CPlayerSpecificInfoCallback * cb;
  21. VCAI * ai;
  22. public:
  23. AIPathfinder(CPlayerSpecificInfoCallback * cb, VCAI * ai);
  24. std::vector<AIPath> getPathInfo(HeroPtr hero, int3 tile);
  25. bool isTileAccessible(HeroPtr hero, int3 tile);
  26. std::shared_ptr<AINodeStorage> getOrCreateStorage(HeroPtr hero);
  27. void clear();
  28. };