Use Segments for RandomMetadata (#11190)

* use segments for randomized names now

* separator datafields

* public api
This commit is contained in:
Nemanja
2022-09-14 03:13:22 -04:00
committed by GitHub
parent f14f3d4999
commit cff6fe267c
7 changed files with 43 additions and 38 deletions

View File

@@ -1,17 +1,20 @@
using Content.Shared.Dataset;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.RandomMetadata;
namespace Content.Server.RandomMetadata;
/// <summary>
/// Randomizes the description and/or the name for an entity by pulling from a dataset prototype.
/// Randomizes the description and/or the name for an entity by creating it from list of dataset prototypes or strings.
/// </summary>
[RegisterComponent]
public sealed class RandomMetadataComponent : Component
{
[DataField("descriptionSet", customTypeSerializer:typeof(PrototypeIdSerializer<DatasetPrototype>))]
public string? DescriptionSet;
[DataField("descriptionSegments")]
public List<string>? DescriptionSegments;
[DataField("nameSet", customTypeSerializer:typeof(PrototypeIdSerializer<DatasetPrototype>))]
public string? NameSet;
[DataField("nameSegments")]
public List<string>? NameSegments;
[DataField("nameSeparator")]
public string NameSeparator = " ";
[DataField("descriptionSeparator")]
public string DescriptionSeparator = " ";
}