1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-04 23:17:41 +02:00
vcmi/lib/entities/artifact/ArtSlotInfo.cpp
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

43 lines
846 B
C++

/*
* ArtSlotInfo.cpp, 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
*
*/
#include "StdInc.h"
#include "ArtSlotInfo.h"
#include "../../callback/CPrivilegedInfoCallback.h"
VCMI_LIB_NAMESPACE_BEGIN
ArtSlotInfo::ArtSlotInfo(CPrivilegedInfoCallback * cb)
: GameCallbackHolder(cb)
{
}
ArtSlotInfo::ArtSlotInfo(const CArtifactInstance * artifact, bool locked)
: GameCallbackHolder(artifact->cb)
, artifactID(artifact->getId())
, locked(locked)
{
}
const CArtifactInstance * ArtSlotInfo::getArt() const
{
if(!artifactID.hasValue())
return nullptr;
return cb->getArtInstance(artifactID);
}
ArtifactInstanceID ArtSlotInfo::getID() const
{
return artifactID;
}
VCMI_LIB_NAMESPACE_END