mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-02 18:17:09 +02:00
26 lines
825 B
C#
26 lines
825 B
C#
namespace Robust.Shared.Serialization.Manager;
|
|
|
|
// TODO Serialization: make this actually not kanser to use holy moly (& allow generics)
|
|
public interface ISerializationContext
|
|
{
|
|
SerializationManager.SerializerProvider SerializerProvider { get; }
|
|
|
|
// This is just here for content tests that may want their own test diffs.
|
|
/// <summary>
|
|
/// Are we currently iterating prototypes or entities for writing.
|
|
/// </summary>
|
|
bool WritingReadingPrototypes { get; }
|
|
}
|
|
|
|
public sealed class EntityDiffContext : ISerializationContext
|
|
{
|
|
public SerializationManager.SerializerProvider SerializerProvider { get; }
|
|
public bool WritingReadingPrototypes { get; set; } = true;
|
|
|
|
public EntityDiffContext()
|
|
{
|
|
SerializerProvider = new();
|
|
SerializerProvider.RegisterSerializer(this);
|
|
}
|
|
}
|