6
StarHorizon_Public/Content.Server/RandomMetadata/RandomMetadataComponent.cs
2025-08-13 15:03:01 +03:00

32 lines
1.2 KiB
C#

using Content.Shared.Dataset;
using Robust.Shared.Prototypes;
namespace Content.Server.RandomMetadata;
/// <summary>
/// Randomizes the description and/or the name for an entity by creating it from list of dataset prototypes or strings.
/// </summary>
[RegisterComponent]
public sealed partial class RandomMetadataComponent : Component
{
[DataField]
public List<ProtoId<LocalizedDatasetPrototype>>? DescriptionSegments;
[DataField]
public List<ProtoId<LocalizedDatasetPrototype>>? NameSegments;
/// <summary>
/// LocId of the formatting string to use to assemble the <see cref="NameSegments"/> into the entity's name.
/// Segments will be passed to the localization system with this string as variables named $part0, $part1, $part2, etc.
/// </summary>
[DataField]
public LocId NameFormat = "random-metadata-name-format-default";
/// <summary>
/// LocId of the formatting string to use to assemble the <see cref="DescriptionSegments"/> into the entity's description.
/// Segments will be passed to the localization system with this string as variables named $part0, $part1, $part2, etc.
/// </summary>
[DataField]
public LocId DescriptionFormat = "random-metadata-description-format-default";
}