RandomFillSolution.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. using Content.Shared.Chemistry.Reagent;
  2. using Content.Shared.FixedPoint;
  3. using Robust.Shared.Serialization;
  4. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  5. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
  6. namespace Content.Shared.Random;
  7. /// <summary>
  8. /// Data that specifies reagents that share the same weight and quantity for use with WeightedRandomSolution.
  9. /// </summary>
  10. [Serializable, NetSerializable]
  11. [DataDefinition]
  12. public sealed partial class RandomFillSolution
  13. {
  14. /// <summary>
  15. /// Quantity of listed reagents.
  16. /// </summary>
  17. [DataField("quantity")]
  18. public FixedPoint2 Quantity = 0;
  19. /// <summary>
  20. /// Random weight of listed reagents.
  21. /// </summary>
  22. [DataField("weight")]
  23. public float Weight = 0;
  24. /// <summary>
  25. /// Listed reagents that the weight and quantity apply to.
  26. /// </summary>
  27. [DataField("reagents", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<ReagentPrototype>))]
  28. public List<string> Reagents = new();
  29. }