mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Merge branch 'develop' into delete
This commit is contained in:
@@ -235,25 +235,6 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
loadPointerImpl(data);
|
||||
}
|
||||
|
||||
template < typename T, typename std::enable_if_t < std::is_base_of_v<Entity, std::remove_pointer_t<T>>, int > = 0 >
|
||||
void loadPointerImpl(T &data)
|
||||
{
|
||||
using DataType = std::remove_pointer_t<T>;
|
||||
|
||||
typename DataType::IdentifierType index;
|
||||
load(index);
|
||||
|
||||
auto * constEntity = index.toEntity(VLC);
|
||||
auto * constData = dynamic_cast<const DataType *>(constEntity);
|
||||
data = const_cast<DataType *>(constData);
|
||||
}
|
||||
|
||||
template < typename T, typename std::enable_if_t < !std::is_base_of_v<Entity, std::remove_pointer_t<T>>, int > = 0 >
|
||||
void loadPointerImpl(T &data)
|
||||
{
|
||||
if(reader->smartVectorMembersSerialization)
|
||||
{
|
||||
typedef typename std::remove_const_t<typename std::remove_pointer_t<T>> TObjectType; //eg: const CGHeroInstance * => CGHeroInstance
|
||||
|
||||
@@ -186,19 +186,6 @@ public:
|
||||
if(data == nullptr)
|
||||
return;
|
||||
|
||||
savePointerImpl(data);
|
||||
}
|
||||
|
||||
template < typename T, typename std::enable_if_t < std::is_base_of_v<Entity, std::remove_pointer_t<T>>, int > = 0 >
|
||||
void savePointerImpl(const T &data)
|
||||
{
|
||||
auto index = data->getId();
|
||||
save(index);
|
||||
}
|
||||
|
||||
template < typename T, typename std::enable_if_t < !std::is_base_of_v<Entity, std::remove_pointer_t<T>>, int > = 0 >
|
||||
void savePointerImpl(const T &data)
|
||||
{
|
||||
typedef typename std::remove_const_t<typename std::remove_pointer_t<T>> TObjectType;
|
||||
|
||||
if(writer->smartVectorMembersSerialization)
|
||||
|
||||
@@ -65,7 +65,9 @@ enum class ESerializationVersion : int32_t
|
||||
LOCAL_PLAYER_STATE_DATA, // 866 - player state contains arbitrary client-side data
|
||||
REMOVE_TOWN_PTR, // 867 - removed pointer to CTown from CGTownInstance
|
||||
REMOVE_OBJECT_TYPENAME, // 868 - remove typename from CGObjectInstance
|
||||
LOBBY_DELETE, // 869 - possibility to delete savegames and random maps
|
||||
REMOVE_VLC_POINTERS, // 869 removed remaining pointers to VLC entities
|
||||
FOLDER_NAME_REWORK, // 870 - rework foldername
|
||||
LOBBY_DELETE, // 871 - possibility to delete savegames and random maps
|
||||
|
||||
CURRENT = LOBBY_DELETE
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user