2
0

Explore.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Explore.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 "CGoal.h"
  12. struct HeroPtr;
  13. class VCAI;
  14. class FuzzyHelper;
  15. namespace Goals
  16. {
  17. struct ExplorationHelper;
  18. class DLL_EXPORT Explore : public CGoal<Explore>
  19. {
  20. private:
  21. bool allowGatherArmy;
  22. public:
  23. Explore(bool allowGatherArmy)
  24. : CGoal(Goals::EXPLORE), allowGatherArmy(allowGatherArmy)
  25. {
  26. priority = 1;
  27. }
  28. Explore()
  29. : Explore(true)
  30. {
  31. }
  32. Explore(HeroPtr h)
  33. : CGoal(Goals::EXPLORE)
  34. {
  35. hero = h;
  36. priority = 1;
  37. }
  38. TGoalVec getAllPossibleSubgoals() override;
  39. TSubgoal whatToDoToAchieve() override;
  40. std::string completeMessage() const override;
  41. bool fulfillsMe(TSubgoal goal) override;
  42. bool operator==(const Explore & other) const override;
  43. private:
  44. TSubgoal exploreNearestNeighbour(HeroPtr h) const;
  45. TSubgoal explorationNewPoint(HeroPtr h) const;
  46. TSubgoal explorationBestNeighbour(int3 hpos, HeroPtr h) const;
  47. void explorationScanTile(const int3 & tile, ExplorationHelper & scanResult) const;
  48. bool hasReachableNeighbor(const int3 &pos, HeroPtr hero, CCallback * cbp, VCAI * vcai) const;
  49. void getVisibleNeighbours(
  50. const std::vector<int3> & tiles,
  51. std::vector<int3> & out,
  52. CCallback * cbp,
  53. const TeamState * ts) const;
  54. int howManyTilesWillBeDiscovered(const int3 & pos, ExplorationHelper & scanResult) const;
  55. };
  56. }