CPrivilegedInfoCallback.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * CPrivilegedInfoCallback.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 "CGameInfoCallback.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. namespace vstd
  14. {
  15. class RNG;
  16. }
  17. class DLL_LINKAGE CPrivilegedInfoCallback : public CGameInfoCallback
  18. {
  19. public:
  20. using CGameInfoCallback::gameState; // make public
  21. //used for random spawns
  22. void getFreeTiles(std::vector<int3> &tiles) const;
  23. //mode 1 - only unrevealed tiles; mode 0 - all, mode -1 - only revealed
  24. void getTilesInRange(std::unordered_set<int3> & tiles,
  25. const int3 & pos,
  26. int radius,
  27. ETileVisibility mode,
  28. std::optional<PlayerColor> player = std::optional<PlayerColor>(),
  29. int3::EDistanceFormula formula = int3::DIST_2D) const;
  30. //returns all tiles on given level (-1 - both levels, otherwise number of level)
  31. void getAllTiles(std::unordered_set<int3> &tiles, std::optional<PlayerColor> player, int level, std::function<bool(const TerrainTile *)> filter) const;
  32. //gives 3 treasures, 3 minors, 1 major -> used by Black Market and Artifact Merchant
  33. void pickAllowedArtsSet(std::vector<ArtifactID> & out, vstd::RNG & rand);
  34. void getAllowedSpells(std::vector<SpellID> &out, std::optional<ui16> level = std::nullopt);
  35. };
  36. VCMI_LIB_NAMESPACE_END