AIMovementAfterDestinationRule.h 2.0 KB

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