CPrivilegedInfoCallback.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #if SCRIPTING_ENABLED
  18. namespace scripting
  19. {
  20. class Pool;
  21. }
  22. #endif
  23. class DLL_LINKAGE CPrivilegedInfoCallback : public CGameInfoCallback
  24. {
  25. public:
  26. #if SCRIPTING_ENABLED
  27. virtual scripting::Pool * getGlobalContextPool() const = 0;
  28. #endif
  29. using CGameInfoCallback::gameState; // make public
  30. //used for random spawns
  31. void getFreeTiles(std::vector<int3> &tiles) const;
  32. //mode 1 - only unrevealed tiles; mode 0 - all, mode -1 - only revealed
  33. void getTilesInRange(std::unordered_set<int3> & tiles,
  34. const int3 & pos,
  35. int radius,
  36. ETileVisibility mode,
  37. std::optional<PlayerColor> player = std::optional<PlayerColor>(),
  38. int3::EDistanceFormula formula = int3::DIST_2D) const;
  39. //returns all tiles on given level (-1 - both levels, otherwise number of level)
  40. void getAllTiles(std::unordered_set<int3> &tiles, std::optional<PlayerColor> player, int level, std::function<bool(const TerrainTile *)> filter) const;
  41. //gives 3 treasures, 3 minors, 1 major -> used by Black Market and Artifact Merchant
  42. void pickAllowedArtsSet(std::vector<ArtifactID> & out, vstd::RNG & rand);
  43. void getAllowedSpells(std::vector<SpellID> &out, std::optional<ui16> level = std::nullopt);
  44. };
  45. VCMI_LIB_NAMESPACE_END