RandomFillSolutionComponent.cs 919 B

123456789101112131415161718192021222324
  1. using Content.Server.Chemistry.EntitySystems;
  2. using Content.Shared.Random;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
  4. namespace Content.Server.Chemistry.Components;
  5. /// <summary>
  6. /// Fills a solution container randomly using a weighted random prototype
  7. /// </summary>
  8. [RegisterComponent, Access(typeof(SolutionRandomFillSystem))]
  9. public sealed partial class RandomFillSolutionComponent : Component
  10. {
  11. /// <summary>
  12. /// Solution name which to add reagents to.
  13. /// </summary>
  14. [DataField("solution")]
  15. public string Solution { get; set; } = "default";
  16. /// <summary>
  17. /// Weighted random fill prototype Id. Used to pick reagent and quantity.
  18. /// </summary>
  19. [DataField("weightedRandomId", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<WeightedRandomFillSolutionPrototype>))]
  20. public string? WeightedRandomId;
  21. }