CatStation/Content.Shared/Random/IWeightedRandom.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

21 lines
631 B
C#

using Robust.Shared.Prototypes;
namespace Content.Shared.Random;
/// <summary>
/// IWeightedRandomPrototype implements a dictionary of strings to float weights
/// to be used with <see cref="Helpers.SharedRandomExtensions.Pick(IWeightedRandomPrototype, Robust.Shared.Random.IRobustRandom)" />.
/// </summary>
public interface IWeightedRandomPrototype : IPrototype
{
[ViewVariables]
public Dictionary<string, float> Weights { get; }
}
public interface IWeightedRandomPrototype<TProto> : IPrototype
where
TProto: class, IPrototype
{
[ViewVariables]
public Dictionary<ProtoId<TProto>, float> Weights { get; }
}