CatStation/Content.Shared/Random/WeightedRandomEntityPrototype.cs
deltanedas cf7fde3d62
Big prototype and datafield cleanup (#45202)
* giant protoid cleanup

* yml changes

* !

---------

Co-authored-by: deltanedas <@deltanedas:goida.zip>
2026-08-12 02:07:22 +00:00

18 lines
636 B
C#

using Robust.Shared.Prototypes;
namespace Content.Shared.Random;
// TODO: replace all uses of this with entity tables
/// <summary>
/// Linter-friendly version of weightedRandom for Entity prototypes.
/// </summary>
[Prototype]
public sealed partial class WeightedRandomEntityPrototype : IWeightedRandomPrototype<EntityPrototype>
{
[IdDataField]
public string ID { get; private set; } = default!;
// WeightedRandomPrototype works off of a generic ProtoId, so we can't use EntProtoId directly.
[DataField(required: true)]
public Dictionary<ProtoId<EntityPrototype>, float> Weights { get; private set; } = new();
}