AIMovementAfterDestinationRule.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. const Nullkiller * ai;
  25. std::shared_ptr<AINodeStorage> nodeStorage;
  26. bool allowBypassObjects;
  27. public:
  28. AIMovementAfterDestinationRule(
  29. const Nullkiller * ai,
  30. CPlayerSpecificInfoCallback * cb,
  31. std::shared_ptr<AINodeStorage> nodeStorage,
  32. bool allowBypassObjects);
  33. virtual void process(
  34. const PathNodeInfo & source,
  35. CDestinationNodeInfo & destination,
  36. const PathfinderConfig * pathfinderConfig,
  37. CPathfinderHelper * pathfinderHelper) const override;
  38. private:
  39. bool bypassDestinationGuards(
  40. std::vector<const CGObjectInstance *> destGuardians,
  41. const PathNodeInfo & source,
  42. CDestinationNodeInfo & destination,
  43. const PathfinderConfig * pathfinderConfig,
  44. CPathfinderHelper * pathfinderHelper) const;
  45. bool bypassRemovableObject(
  46. const PathNodeInfo & source,
  47. CDestinationNodeInfo & destination,
  48. const PathfinderConfig * pathfinderConfig,
  49. CPathfinderHelper * pathfinderHelper) const;
  50. bool bypassBlocker(
  51. const PathNodeInfo & source,
  52. CDestinationNodeInfo & destination,
  53. const PathfinderConfig * pathfinderConfig,
  54. CPathfinderHelper * pathfinderHelper) const;
  55. bool bypassBattle(
  56. const PathNodeInfo & source,
  57. CDestinationNodeInfo & destination,
  58. const PathfinderConfig * pathfinderConfig,
  59. CPathfinderHelper * pathfinderHelper) const;
  60. bool bypassQuest(
  61. const PathNodeInfo & source,
  62. CDestinationNodeInfo & destination,
  63. const PathfinderConfig * pathfinderConfig,
  64. CPathfinderHelper * pathfinderHelper) const;
  65. };
  66. }
  67. }