NodeStorage.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * NodeStorage.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 "INodeStorage.h"
  12. #include "CGPathNode.h"
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. class DLL_LINKAGE NodeStorage : public INodeStorage
  15. {
  16. private:
  17. CPathsInfo & out;
  18. STRONG_INLINE
  19. void resetTile(const int3 & tile, const EPathfindingLayer & layer, EPathAccessibility accessibility);
  20. public:
  21. NodeStorage(CPathsInfo & pathsInfo, const CGHeroInstance * hero);
  22. STRONG_INLINE
  23. CGPathNode * getNode(const int3 & coord, const EPathfindingLayer layer)
  24. {
  25. return out.getNode(coord, layer);
  26. }
  27. void initialize(const PathfinderOptions & options, const CGameState * gs) override;
  28. virtual ~NodeStorage() = default;
  29. virtual std::vector<CGPathNode *> getInitialNodes() override;
  30. virtual std::vector<CGPathNode *> calculateNeighbours(
  31. const PathNodeInfo & source,
  32. const PathfinderConfig * pathfinderConfig,
  33. const CPathfinderHelper * pathfinderHelper) override;
  34. virtual std::vector<CGPathNode *> calculateTeleportations(
  35. const PathNodeInfo & source,
  36. const PathfinderConfig * pathfinderConfig,
  37. const CPathfinderHelper * pathfinderHelper) override;
  38. virtual void commit(CDestinationNodeInfo & destination, const PathNodeInfo & source) override;
  39. };
  40. VCMI_LIB_NAMESPACE_END