mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-16 07:12:27 +02:00
* Add serialization write benchmark * Add baseline test and rename AddNode to Add in mapping extensions * Optimize serialization writing * Make reader delegate private * Unhardcode baseline test
28 lines
923 B
C#
28 lines
923 B
C#
using System.Collections.Generic;
|
|
using Robust.Shared.Serialization.Markdown.Sequence;
|
|
using Robust.Shared.Serialization.Markdown.Value;
|
|
|
|
namespace Robust.Shared.Serialization.Markdown.Mapping
|
|
{
|
|
public static class MappingDataNodeExtensions
|
|
{
|
|
public static MappingDataNode Add(this MappingDataNode mapping, string key, DataNode node)
|
|
{
|
|
mapping.Add(new ValueDataNode(key), node);
|
|
return mapping;
|
|
}
|
|
|
|
public static MappingDataNode Add(this MappingDataNode mapping, string key, string value)
|
|
{
|
|
mapping.Add(new ValueDataNode(key), new ValueDataNode(value));
|
|
return mapping;
|
|
}
|
|
|
|
public static MappingDataNode Add(this MappingDataNode mapping, string key, List<string> sequence)
|
|
{
|
|
mapping.Add(new ValueDataNode(key), new SequenceDataNode(sequence));
|
|
return mapping;
|
|
}
|
|
}
|
|
}
|