1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Merge CPrivilegedInfoCallback into CGameInfoCallback

This commit is contained in:
Ivan Savenko
2025-05-14 13:39:37 +03:00
parent b37a3dc63c
commit 6f20235d07
96 changed files with 345 additions and 384 deletions

View File

@@ -11,7 +11,7 @@
VCMI_LIB_NAMESPACE_BEGIN
class CPrivilegedInfoCallback;
class CGameInfoCallback;
class Serializeable;
class GameCallbackHolder;
class BinaryDeserializer;
@@ -21,7 +21,7 @@ class GameCallbackHolder;
template <typename T, typename Enable = void>
struct ClassObjectCreator
{
static T *invoke(CPrivilegedInfoCallback *cb)
static T *invoke(CGameInfoCallback *cb)
{
static_assert(!std::is_base_of_v<GameCallbackHolder, T>, "Cannot call new upon map objects!");
static_assert(!std::is_abstract_v<T>, "Cannot call new upon abstract classes!");
@@ -32,7 +32,7 @@ struct ClassObjectCreator
template<typename T>
struct ClassObjectCreator<T, typename std::enable_if_t<std::is_base_of_v<GameCallbackHolder, T>>>
{
static T *invoke(CPrivilegedInfoCallback *cb)
static T *invoke(CGameInfoCallback *cb)
{
static_assert(!std::is_abstract_v<T>, "Cannot call new upon abstract classes!");
return new T(cb);
@@ -42,8 +42,8 @@ struct ClassObjectCreator<T, typename std::enable_if_t<std::is_base_of_v<GameCal
class ISerializerReflection
{
public:
virtual Serializeable * createPtr(BinaryDeserializer &ar, CPrivilegedInfoCallback * cb) const =0;
virtual void loadPtr(BinaryDeserializer &ar, CPrivilegedInfoCallback * cb, Serializeable * data) const =0;
virtual Serializeable * createPtr(BinaryDeserializer &ar, CGameInfoCallback * cb) const =0;
virtual void loadPtr(BinaryDeserializer &ar, CGameInfoCallback * cb, Serializeable * data) const =0;
virtual void savePtr(BinarySerializer &ar, const Serializeable *data) const =0;
virtual ~ISerializerReflection() = default;
};