// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
#include "Engine/Core/ISerializable.h"
#include "ManagedCLR/MTypes.h"
///
/// Managed objects serialization utilities. Helps with C# scripts saving to JSON or loading.
///
class FLAXENGINE_API ManagedSerialization
{
public:
#if USE_MONO
///
/// Serializes managed object to JSON.
///
/// The output stream.
/// The object to serialize.
static void Serialize(ISerializable::SerializeStream& stream, MObject* object);
///
/// Serializes managed object difference to JSON.
///
/// The output stream.
/// The object to serialize.
/// The reference object to serialize diff compared to it.
static void SerializeDiff(ISerializable::SerializeStream& stream, MObject* object, MObject* other);
///
/// Deserializes managed object from the JSON.
///
/// The input stream.
/// The object to deserialize.
static void Deserialize(ISerializable::DeserializeStream& stream, MObject* object);
///
/// Deserializes managed object from the JSON.
///
/// The input data.
/// The object to deserialize.
static void Deserialize(const StringAnsiView& data, MObject* object);
#endif
};