Files
RobustToolbox/Robust.Shared/Serialization/ISelfSerialize.cs
T
4747e5a05a Add and update a lot of documentation (#6337)
* Serialization docs

Co-authored-by: Moony <moonheart08@users.noreply.github.com>

* ECS docs

Co-authored-by: Moony <moonheart08@users.noreply.github.com>

* scattered docs

Co-authored-by: Moony <moonheart08@users.noreply.github.com>

* Fixes

---------

Co-authored-by: Moony <moonheart08@users.noreply.github.com>
Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
2025-12-15 20:26:17 +01:00

28 lines
1.1 KiB
C#

using Robust.Shared.Serialization.TypeSerializers.Interfaces;
namespace Robust.Shared.Serialization
{
/// <summary>
/// Allows a type with an argument-free constructor (i.e. <c>new()</c>) to provide its own serializer and
/// deserializer in place from a string, without deferring to an <see cref="ITypeSerializer{TType,TNode}"/>.
/// </summary>
/// <remarks>
/// This is much more limited than a full serializer, and only allows working with a scalar, but may be
/// convenient.
/// </remarks>
public interface ISelfSerialize
{
/// <summary>
/// Deserialize the type from a given string value, after having already constructed one with <c>new()</c>.
/// </summary>
/// <param name="value">The scalar to deserialize from.</param>
void Deserialize(string value);
/// <summary>
/// Serialize the type to a yaml scalar (i.e. string).
/// </summary>
/// <returns>The serialized representation of the data.</returns>
string Serialize();
}
}