2021-02-27 04:12:09 +01:00
|
|
|
#nullable enable
|
2019-04-05 02:04:34 +02:00
|
|
|
using System.Collections.Generic;
|
2021-02-27 04:12:09 +01:00
|
|
|
using System.Data;
|
2019-04-15 21:11:38 -06:00
|
|
|
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")]
|
2021-02-20 00:05:24 +01:00
|
|
|
public sealed class SoundCollectionPrototype : IPrototype
|
2019-04-05 02:04:34 +02:00
|
|
|
{
|
2021-02-27 04:12:09 +01: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();
|
|
|
|
|
|
2021-02-27 04:12:09 +01:00
|
|
|
// 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"))
|
|
|
|
|
{
|
2021-02-27 04:12:09 +01:00
|
|
|
PickFiles.Add(file.AsString());
|
2019-04-05 02:04:34 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|