ExplorationHelper.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * ExplorationHelper.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 "../AIUtility.h"
  12. #include "../../../lib/GameConstants.h"
  13. #include "../../../lib/VCMI_Lib.h"
  14. #include "../../../lib/CTownHandler.h"
  15. #include "../../../lib/CBuildingHandler.h"
  16. #include "../Goals/AbstractGoal.h"
  17. namespace NKAI
  18. {
  19. class ExplorationHelper
  20. {
  21. private:
  22. const CGHeroInstance * hero;
  23. int sightRadius;
  24. float bestValue;
  25. Goals::TSubgoal bestGoal;
  26. int3 bestTile;
  27. int bestTilesDiscovered;
  28. const Nullkiller * ai;
  29. CCallback * cbp;
  30. const TeamState * ts;
  31. int3 ourPos;
  32. bool allowDeadEndCancellation;
  33. bool useCPathfinderAccessibility;
  34. public:
  35. ExplorationHelper(const CGHeroInstance * hero, const Nullkiller * ai, bool useCPathfinderAccessibility = false);
  36. Goals::TSubgoal makeComposition() const;
  37. bool scanSector(int scanRadius);
  38. bool scanMap();
  39. int howManyTilesWillBeDiscovered(const int3 & pos) const;
  40. private:
  41. void scanTile(const int3 & tile);
  42. bool hasReachableNeighbor(const int3 & pos) const;
  43. };
  44. }