Add linter-friendly WeightedRandom prototypes (#18729)

This commit is contained in:
Vordenburg
2023-08-05 22:31:25 -04:00
committed by GitHub
parent 9c84108672
commit cc8b642444
16 changed files with 88 additions and 21 deletions

View File

@@ -0,0 +1,18 @@
using Content.Shared.Mining;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
namespace Content.Shared.Random;
/// <summary>
/// Linter-friendly version of weightedRandom for Ore prototypes.
/// </summary>
[Prototype("weightedRandomOre")]
public sealed class WeightedRandomOrePrototype : IWeightedRandomPrototype
{
[IdDataField]
public string ID { get; } = default!;
[DataField("weights", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<float, OrePrototype>))]
public Dictionary<string, float> Weights { get; } = new();
}