mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
minimized visibility of members of teleportation-related classes
This commit is contained in:
@@ -265,29 +265,33 @@ struct DLL_LINKAGE TeleportChannel
|
||||
|
||||
class DLL_LINKAGE CGTeleport : public CGObjectInstance
|
||||
{
|
||||
public:
|
||||
enum EType {UNKNOWN, ENTRANCE, EXIT, BOTH};
|
||||
|
||||
EType type;
|
||||
TeleportChannelID channel;
|
||||
|
||||
CGTeleport();
|
||||
bool isEntrance() const;
|
||||
bool isExit() const;
|
||||
bool isChannelEntrance(ObjectInstanceID id) const;
|
||||
bool isChannelExit(ObjectInstanceID id) const;
|
||||
|
||||
std::vector<ObjectInstanceID> getAllEntrances(bool excludeCurrent = false) const;
|
||||
std::vector<ObjectInstanceID> getAllExits(bool excludeCurrent = false) const;
|
||||
|
||||
protected:
|
||||
enum EType {UNKNOWN, ENTRANCE, EXIT, BOTH};
|
||||
EType type;
|
||||
|
||||
CGTeleport();
|
||||
ObjectInstanceID getRandomExit(const CGHeroInstance * h) const;
|
||||
std::vector<ObjectInstanceID> getAllExits(bool excludeCurrent = false) const;
|
||||
|
||||
public:
|
||||
TeleportChannelID channel;
|
||||
|
||||
bool isEntrance() const;
|
||||
bool isExit() const;
|
||||
|
||||
virtual void teleportDialogAnswered(const CGHeroInstance *hero, ui32 answer, std::vector<ObjectInstanceID> exits) const = 0;
|
||||
|
||||
static bool isTeleport(const CGObjectInstance * dst);
|
||||
static bool isConnected(const CGTeleport * src, const CGTeleport * dst);
|
||||
static bool isConnected(const CGObjectInstance * src, const CGObjectInstance * dst);
|
||||
static bool isExitPassable(CGameState * gs, const CGHeroInstance * h, const CGObjectInstance * obj);
|
||||
static std::vector<ObjectInstanceID> getPassableExits(CGameState * gs, const CGHeroInstance * h, std::vector<ObjectInstanceID> exits);
|
||||
static void addToChannel(std::map<TeleportChannelID, shared_ptr<TeleportChannel> > &channelsList, const CGTeleport * obj);
|
||||
static std::vector<ObjectInstanceID> getPassableExits(CGameState * gs, const CGHeroInstance * h, std::vector<ObjectInstanceID> exits);
|
||||
static bool isExitPassable(CGameState * gs, const CGHeroInstance * h, const CGObjectInstance * obj);
|
||||
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
@@ -299,11 +303,12 @@ class DLL_LINKAGE CGMonolith : public CGTeleport
|
||||
{
|
||||
TeleportChannelID findMeChannel(std::vector<Obj> IDs, int SubID) const;
|
||||
|
||||
public:
|
||||
protected:
|
||||
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||
void teleportDialogAnswered(const CGHeroInstance *hero, ui32 answer, std::vector<ObjectInstanceID> exits) const override;
|
||||
void initObj() override;
|
||||
|
||||
public:
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
h & static_cast<CGTeleport&>(*this);
|
||||
@@ -312,9 +317,10 @@ public:
|
||||
|
||||
class DLL_LINKAGE CGSubterraneanGate : public CGMonolith
|
||||
{
|
||||
public:
|
||||
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||
void initObj() override;
|
||||
|
||||
public:
|
||||
static void postInit();
|
||||
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
@@ -325,11 +331,11 @@ public:
|
||||
|
||||
class DLL_LINKAGE CGWhirlpool : public CGMonolith
|
||||
{
|
||||
public:
|
||||
void onHeroVisit(const CGHeroInstance * h) const override;
|
||||
void teleportDialogAnswered(const CGHeroInstance *hero, ui32 answer, std::vector<ObjectInstanceID> exits) const override;
|
||||
static bool isProtected( const CGHeroInstance * h );
|
||||
|
||||
public:
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
h & static_cast<CGMonolith&>(*this);
|
||||
|
Reference in New Issue
Block a user