WeightedRandomOrePrototype.cs 645 B

123456789101112131415161718
  1. using Content.Shared.Mining;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
  4. namespace Content.Shared.Random;
  5. /// <summary>
  6. /// Linter-friendly version of weightedRandom for Ore prototypes.
  7. /// </summary>
  8. [Prototype]
  9. public sealed partial class WeightedRandomOrePrototype : IWeightedRandomPrototype
  10. {
  11. [IdDataField]
  12. public string ID { get; private set; } = default!;
  13. [DataField("weights", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<float, OrePrototype>))]
  14. public Dictionary<string, float> Weights { get; private set; } = new();
  15. }