/* * CGameInfoCallback.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 "IGameInfoCallback.h" VCMI_LIB_NAMESPACE_BEGIN struct SThievesGuildInfo; class Player; class DLL_LINKAGE CGameInfoCallback : public IGameInfoCallback { protected: bool hasAccess(std::optional playerId) const; bool canGetFullInfo(const CGObjectInstance *obj) const; //true we player owns obj or ally owns obj or privileged mode public: //various int getDate(Date mode=Date::DAY)const override; //mode=0 - total days in game, mode=1 - day of week, mode=2 - current week, mode=3 - current month const StartInfo * getStartInfo() const override; const StartInfo * getInitialStartInfo() const; bool isAllowed(SpellID id) const override; bool isAllowed(ArtifactID id) const override; bool isAllowed(SecondarySkill id) const override; const IGameSettings & getSettings() const override; //player virtual std::optional getPlayerID() const; const Player * getPlayer(PlayerColor color) const; const PlayerState * getPlayerState(PlayerColor color, bool verbose = true) const override; int getResource(PlayerColor Player, GameResID which) const override; PlayerRelations getPlayerRelations(PlayerColor color1, PlayerColor color2) const override; void getThievesGuildInfo(SThievesGuildInfo & thi, const CGObjectInstance * obj); EPlayerStatus getPlayerStatus(PlayerColor player, bool verbose = true) const override; bool isPlayerMakingTurn(PlayerColor player) const; const PlayerSettings * getPlayerSettings(PlayerColor color) const override; TurnTimerInfo getPlayerTurnTime(PlayerColor color) const; //map bool isVisibleFor(int3 pos, PlayerColor player) const override; bool isVisibleFor(const CGObjectInstance * obj, PlayerColor player) const override; bool isVisible(const CGObjectInstance * obj) const; bool isVisible(int3 pos) const; //armed object void fillUpgradeInfo(const CArmedInstance *obj, SlotID stackPos, UpgradeInfo &out) const; //hero const CGHeroInstance * getHero(ObjectInstanceID objid) const override; int getHeroCount(PlayerColor player, bool includeGarrisoned) const override; bool getHeroInfo(const CGObjectInstance * hero, InfoAboutHero & dest, const CGObjectInstance * selectedObject = nullptr) const; int32_t getSpellCost(const spells::Spell * sp, const CGHeroInstance * caster) const; int64_t estimateSpellDamage(const CSpell * sp, const CGHeroInstance * hero) const; const CArtifactInstance * getArtInstance(ArtifactInstanceID aid) const override; const CGObjectInstance * getObjInstance(ObjectInstanceID oid) const override; const CArtifactSet * getArtSet(const ArtifactLocation & loc) const; //objects const CGObjectInstance * getObj(ObjectInstanceID objid, bool verbose = true) const override; std::vector getBlockingObjs(int3 pos) const; std::vector getVisitableObjs(int3 pos, bool verbose = true) const; std::vector getAllVisitableObjs() const; std::vector getFlaggableObjects(int3 pos) const; const CGObjectInstance * getTopObj(int3 pos) const override; PlayerColor getOwner(ObjectInstanceID heroID) const; const IMarket * getMarket(ObjectInstanceID objid) const; //map int3 guardingCreaturePosition (int3 pos) const override; std::vector getGuardingCreatures (int3 pos) const override; bool isTileGuardedUnchecked(int3 tile) const; const CMapHeader * getMapHeader()const override; int3 getMapSize() const override; const TerrainTile * getTile(int3 tile, bool verbose = true) const override; const TerrainTile * getTileUnchecked(int3 tile) const override; bool isInTheMap(const int3 &pos) const override; void getVisibleTilesInRange(std::unordered_set &tiles, int3 pos, int radious, int3::EDistanceFormula distanceFormula = int3::DIST_2D) const; void calculatePaths(const std::shared_ptr & config) const override; EDiggingStatus getTileDigStatus(int3 tile, bool verbose = true) const override; bool checkForVisitableDir(const int3 & src, const int3 & dst) const override; //town const CGTownInstance* getTown(ObjectInstanceID objid) const override; int howManyTowns(PlayerColor Player) const; std::vector getAvailableHeroes(const CGObjectInstance * townOrTavern) const; std::string getTavernRumor(const CGObjectInstance * townOrTavern) const; EBuildingState canBuildStructure(const CGTownInstance *t, BuildingID ID); bool getTownInfo(const CGObjectInstance * town, InfoAboutTown & dest, const CGObjectInstance * selectedObject = nullptr) const; //from gs const TeamState *getTeam(TeamID teamID) const override; const TeamState *getPlayerTeam(PlayerColor color) const override; //teleport std::vector getVisibleTeleportObjects(std::vector ids, PlayerColor player) const override; std::vector getTeleportChannelEntrances(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const override; std::vector getTeleportChannelExits(TeleportChannelID id, PlayerColor Player = PlayerColor::UNFLAGGABLE) const override; ETeleportChannelType getTeleportChannelType(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const; bool isTeleportChannelImpassable(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const override; bool isTeleportChannelBidirectional(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const override; bool isTeleportChannelUnidirectional(TeleportChannelID id, PlayerColor player = PlayerColor::UNFLAGGABLE) const override; bool isTeleportEntrancePassable(const CGTeleport * obj, PlayerColor player) const override; //used for random spawns void getFreeTiles(std::vector &tiles) const; void getTilesInRange(std::unordered_set & tiles, const int3 & pos, int radius, ETileVisibility mode, std::optional player = std::optional(), int3::EDistanceFormula formula = int3::DIST_2D) const override; void getAllTiles(std::unordered_set &tiles, std::optional player, int level, std::function filter) const override; void getAllowedSpells(std::vector &out, std::optional level = std::nullopt); #if SCRIPTING_ENABLED virtual scripting::Pool * getGlobalContextPool() const override; #endif }; VCMI_LIB_NAMESPACE_END