Files
tbd-station-14/Content.Shared/Random/WeightedRandomEntityPrototype.cs

18 lines
649 B
C#

using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
namespace Content.Shared.Random;
/// <summary>
/// Linter-friendly version of weightedRandom for Entity prototypes.
/// </summary>
[Prototype("weightedRandomEntity")]
public sealed partial class WeightedRandomEntityPrototype : IWeightedRandomPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
[DataField("weights", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<float, EntityPrototype>))]
public Dictionary<string, float> Weights { get; private set; } = new();
}