mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-01 17:47:24 +02:00
9cd8401cfb
Co-authored-by: deltanedas <@deltanedas:goida.zip> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
26 lines
853 B
C#
26 lines
853 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(ISerializationManager ser)
|
|
{
|
|
SerializerProvider = new(ser);
|
|
SerializerProvider.RegisterSerializer(this);
|
|
}
|
|
}
|