1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

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
This commit is contained in:
Ivan Savenko
2025-05-13 15:24:45 +03:00
parent f7d08a7288
commit 716da918f8
109 changed files with 854 additions and 933 deletions

View File

@ -14,7 +14,7 @@
#include "CCreatureHandler.h"
#include "GameLibrary.h"
#include "IGameSettings.h"
#include "callback/IGameCallback.h"
#include "callback/CPrivilegedInfoCallback.h"
#include "entities/hero/CHeroHandler.h"
#include "mapObjects/CGHeroInstance.h"
#include "modding/ModScope.h"
@ -707,7 +707,7 @@ void CCreatureSet::serializeJson(JsonSerializeFormat & handler, const std::strin
}
}
CStackInstance::CStackInstance(IGameCallback *cb, bool isHypothetic)
CStackInstance::CStackInstance(CPrivilegedInfoCallback *cb, bool isHypothetic)
: CBonusSystemNode(isHypothetic)
, CStackBasicDescriptor(nullptr, 0)
, CArtifactSet(cb)
@ -719,7 +719,7 @@ CStackInstance::CStackInstance(IGameCallback *cb, bool isHypothetic)
setNodeType(STACK_INSTANCE);
}
CStackInstance::CStackInstance(IGameCallback *cb, const CreatureID & id, TQuantity Count, bool isHypothetic)
CStackInstance::CStackInstance(CPrivilegedInfoCallback *cb, const CreatureID & id, TQuantity Count, bool isHypothetic)
: CStackInstance(cb, false)
{
setType(id);
@ -1034,11 +1034,11 @@ const IBonusBearer* CStackInstance::getBonusBearer() const
return this;
}
CCommanderInstance::CCommanderInstance(IGameCallback *cb)
CCommanderInstance::CCommanderInstance(CPrivilegedInfoCallback *cb)
:CStackInstance(cb)
{}
CCommanderInstance::CCommanderInstance(IGameCallback *cb, const CreatureID & id)
CCommanderInstance::CCommanderInstance(CPrivilegedInfoCallback *cb, const CreatureID & id)
: CStackInstance(cb)
, name("Commando")
{