Files
wwdpublic/Content.Shared/Random/WeightedRandomEntityPrototype.cs
Tayrtahn 7f3b436dc1 Fix prototypes so they pass analyzer checks (#35435)
(cherry picked from commit 6f925dd61083a3fd377e5d12549ac908985e855f)
2025-09-27 13:54:06 +03:00

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();
}