1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00
Files
vcmi/lib/callback/CPrivilegedInfoCallback.h
Ivan Savenko 716da918f8 Completely remove IGameCallback class
- CClient now inherits directly from CPrivilegedInfoCallback, like
IGameCallback did before. However CClient no longer needs dummy
implementation of IGameEventCallback
- CGObjectInstance hierarchy now uses CPrivilegedInfoCallback for
callback. Actual events can only be emitted in calls that receive
IGameEventCallback pointer, e.g. heroVisit
- CGameHandler now inherits directly from both CPrivilegedInfoCallback
and IGameEventCallback as it did before via IGameCallback
2025-05-14 13:39:41 +03:00

57 lines
1.5 KiB
C++

/*
* CPrivilegedInfoCallback.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
#include "CGameInfoCallback.h"
VCMI_LIB_NAMESPACE_BEGIN
namespace vstd
{
class RNG;
}
#if SCRIPTING_ENABLED
namespace scripting
{
class Pool;
}
#endif
class DLL_LINKAGE CPrivilegedInfoCallback : public CGameInfoCallback
{
public:
#if SCRIPTING_ENABLED
virtual scripting::Pool * getGlobalContextPool() const = 0;
#endif
using CGameInfoCallback::gameState; // make public
//used for random spawns
void getFreeTiles(std::vector<int3> &tiles) const;
//mode 1 - only unrevealed tiles; mode 0 - all, mode -1 - only revealed
void getTilesInRange(std::unordered_set<int3> & tiles,
const int3 & pos,
int radius,
ETileVisibility mode,
std::optional<PlayerColor> player = std::optional<PlayerColor>(),
int3::EDistanceFormula formula = int3::DIST_2D) const;
//returns all tiles on given level (-1 - both levels, otherwise number of level)
void getAllTiles(std::unordered_set<int3> &tiles, std::optional<PlayerColor> player, int level, std::function<bool(const TerrainTile *)> filter) const;
//gives 3 treasures, 3 minors, 1 major -> used by Black Market and Artifact Merchant
void pickAllowedArtsSet(std::vector<ArtifactID> & out, vstd::RNG & rand);
void getAllowedSpells(std::vector<SpellID> &out, std::optional<ui16> level = std::nullopt);
};
VCMI_LIB_NAMESPACE_END