AIMovementAfterDestinationRule.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * AIMovementAfterDestinationRule.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 "../../AIGateway.h"
  13. #include "../../../../CCallback.h"
  14. #include "../../../../lib/mapping/CMap.h"
  15. #include "../../../../lib/mapObjects/MapObjects.h"
  16. namespace AIPathfinding
  17. {
  18. class AIMovementAfterDestinationRule : public MovementAfterDestinationRule
  19. {
  20. private:
  21. CPlayerSpecificInfoCallback * cb;
  22. std::shared_ptr<AINodeStorage> nodeStorage;
  23. public:
  24. AIMovementAfterDestinationRule(CPlayerSpecificInfoCallback * cb, std::shared_ptr<AINodeStorage> nodeStorage);
  25. virtual void process(
  26. const PathNodeInfo & source,
  27. CDestinationNodeInfo & destination,
  28. const PathfinderConfig * pathfinderConfig,
  29. CPathfinderHelper * pathfinderHelper) const override;
  30. private:
  31. bool bypassDestinationGuards(
  32. std::vector<const CGObjectInstance *> destGuardians,
  33. const PathNodeInfo & source,
  34. CDestinationNodeInfo & destination,
  35. const PathfinderConfig * pathfinderConfig,
  36. CPathfinderHelper * pathfinderHelper) const;
  37. bool bypassRemovableObject(
  38. const PathNodeInfo & source,
  39. CDestinationNodeInfo & destination,
  40. const PathfinderConfig * pathfinderConfig,
  41. CPathfinderHelper * pathfinderHelper) const;
  42. bool bypassBlocker(
  43. const PathNodeInfo & source,
  44. CDestinationNodeInfo & destination,
  45. const PathfinderConfig * pathfinderConfig,
  46. CPathfinderHelper * pathfinderHelper) const;
  47. bool bypassBattle(
  48. const PathNodeInfo & source,
  49. CDestinationNodeInfo & destination,
  50. const PathfinderConfig * pathfinderConfig,
  51. CPathfinderHelper * pathfinderHelper) const;
  52. bool bypassQuest(
  53. const PathNodeInfo & source,
  54. CDestinationNodeInfo & destination,
  55. const PathfinderConfig * pathfinderConfig,
  56. CPathfinderHelper * pathfinderHelper) const;
  57. };
  58. }