mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-01 17:47:24 +02:00
Co-authored-by: Paul <ritter.paul1@gmail.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com> Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
21 lines
562 B
C#
21 lines
562 B
C#
using System;
|
|
using System.Collections.Concurrent;
|
|
|
|
namespace Robust.Shared.Serialization.Manager
|
|
{
|
|
public partial class SerializationManager
|
|
{
|
|
private readonly ConcurrentDictionary<Type, object> _customTypeSerializers = new();
|
|
|
|
internal object GetOrCreateCustomTypeSerializer(Type type)
|
|
{
|
|
return _customTypeSerializers.GetOrAdd(type, CreateSerializer);
|
|
}
|
|
|
|
internal T GetOrCreateCustomTypeSerializer<T>()
|
|
{
|
|
return (T)GetOrCreateCustomTypeSerializer(typeof(T));
|
|
}
|
|
}
|
|
}
|