AIMovementAfterDestinationRule.h 2.0 KB

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