mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-01 17:47:24 +02:00
* 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>
28 lines
1.1 KiB
C#
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();
|
|
}
|
|
}
|