Random metadata component (#7894)

Co-authored-by: Moony <moonheart08@users.noreply.github.com>
This commit is contained in:
Kara
2022-05-02 13:51:03 -07:00
committed by GitHub
parent 1450c6c638
commit f361618a0b
5 changed files with 75 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
using Content.Shared.Dataset;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.RandomMetadata;
/// <summary>
/// Randomizes the description and/or the name for an entity by pulling from a dataset prototype.
/// </summary>
[RegisterComponent]
public sealed class RandomMetadataComponent : Component
{
[DataField("descriptionSet", customTypeSerializer:typeof(PrototypeIdSerializer<DatasetPrototype>))]
public string? DescriptionSet;
[DataField("nameSet", customTypeSerializer:typeof(PrototypeIdSerializer<DatasetPrototype>))]
public string? NameSet;
}