Files
crystall-punk-14/Content.Shared/Audio/SoundCollectionPrototype.cs

30 lines
823 B
C#
Raw Normal View History

#nullable enable
2019-04-05 02:04:34 +02:00
using System.Collections.Generic;
using System.Data;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
2019-04-05 02:04:34 +02:00
using YamlDotNet.RepresentationModel;
namespace Content.Shared.Audio
{
2020-04-28 16:44:22 +02:00
[Prototype("soundCollection")]
public sealed class SoundCollectionPrototype : IPrototype
2019-04-05 02:04:34 +02:00
{
public string ID { get; private set; } = string.Empty;
public List<string> PickFiles { get; private set; } = new();
2019-04-05 02:04:34 +02:00
public void LoadFrom(YamlMappingNode mapping)
{
ID = mapping.GetNode("id").AsString();
// In the unlikely case the method gets called twice
PickFiles.Clear();
2019-04-05 02:04:34 +02:00
foreach (var file in mapping.GetNode<YamlSequenceNode>("files"))
{
PickFiles.Add(file.AsString());
2019-04-05 02:04:34 +02:00
}
}
}
}