using Content.Server.Chemistry.EntitySystems; using Content.Shared.Chemistry.Reagent; using Content.Shared.FixedPoint; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; namespace Content.Server.Chemistry.Components; /// /// Passively decreases a solution's quantity of reagent(s). /// [RegisterComponent, AutoGenerateComponentPause] [Access(typeof(SolutionPurgeSystem))] public sealed partial class SolutionPurgeComponent : Component { /// /// The name of the solution to detract from. /// [DataField("solution", required: true), ViewVariables(VVAccess.ReadWrite)] public string Solution = string.Empty; /// /// The reagent(s) to be ignored when purging the solution /// [DataField("preserve", customTypeSerializer: typeof(PrototypeIdListSerializer))] [ViewVariables(VVAccess.ReadWrite)] public List Preserve = new(); /// /// Amount of reagent(s) that are purged /// [DataField("quantity", required: true), ViewVariables(VVAccess.ReadWrite)] public FixedPoint2 Quantity = default!; /// /// How long it takes to purge once. /// [DataField("duration"), ViewVariables(VVAccess.ReadWrite)] public TimeSpan Duration = TimeSpan.FromSeconds(1); /// /// The time when the next purge will occur. /// [DataField("nextPurgeTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [AutoPausedField] public TimeSpan NextPurgeTime = TimeSpan.FromSeconds(0); }