2020-12-01 17:05:19 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using Robust.Shared.Prototypes;
|
|
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
using YamlDotNet.RepresentationModel;
|
|
|
|
|
|
|
2021-01-14 08:08:55 +01:00
|
|
|
|
namespace Content.Shared.Prototypes
|
2020-12-01 17:05:19 +01:00
|
|
|
|
{
|
|
|
|
|
|
[Prototype("dataset")]
|
|
|
|
|
|
public class DatasetPrototype : IPrototype, IIndexedPrototype
|
|
|
|
|
|
{
|
|
|
|
|
|
private string _id;
|
|
|
|
|
|
public string ID => _id;
|
|
|
|
|
|
|
|
|
|
|
|
private List<string> _values;
|
|
|
|
|
|
public IReadOnlyList<string> Values => _values;
|
|
|
|
|
|
|
|
|
|
|
|
public void LoadFrom(YamlMappingNode mapping)
|
|
|
|
|
|
{
|
|
|
|
|
|
var ser = YamlObjectSerializer.NewReader(mapping);
|
|
|
|
|
|
|
|
|
|
|
|
ser.DataField(ref _id, "id", "");
|
|
|
|
|
|
ser.DataField(ref _values, "values", new List<string>());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|