1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-06 23:26:26 +02:00
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

39 lines
758 B
C++

/*
* CLoadFile.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 "BinaryDeserializer.h"
VCMI_LIB_NAMESPACE_BEGIN
class DLL_LINKAGE CLoadFile : public IBinaryReader
{
BinaryDeserializer serializer;
std::fstream sfile;
int read(std::byte * data, unsigned size) override; //throws!
public:
CLoadFile(const boost::filesystem::path & fname, CPrivilegedInfoCallback * cb); //throws!
template<class T>
void load(T & data)
{
serializer & data;
}
bool hasFeature(BinaryDeserializer::Version v) const
{
return serializer.version >= v;
}
};
VCMI_LIB_NAMESPACE_END