AIMovementAfterDestinationRule.h 2.0 KB

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