CatStation/Content.Shared/Chemistry/Components/SolutionPurgeComponent.cs
Princess Cheeseballs 4d1325bccf
Fix Broken Solution Enumerators (#43789)
* burge

* bruegr

* YAML

* two misc fixes

* snoutta here

* add tests

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Co-authored-by: Janet Blackquill <uhhadd@gmail.com>
2026-05-01 21:20:03 +00:00

42 lines
1.3 KiB
C#

using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Chemistry.Components;
/// <summary>
/// Passively decreases a solution's quantity of reagent(s).
/// </summary>
[RegisterComponent, AutoGenerateComponentPause]
[NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SolutionPurgeSystem))]
public sealed partial class SolutionPurgeComponent : Component
{
/// <summary>
/// The reagent(s) to be ignored when purging the solution
/// </summary>
[DataField]
public List<ProtoId<ReagentPrototype>> Preserve = [];
/// <summary>
/// Amount of reagent(s) that are purged
/// </summary>
[DataField(required: true)]
public FixedPoint2 Quantity;
/// <summary>
/// How long it takes to purge once.
/// </summary>
[DataField]
public TimeSpan Duration = TimeSpan.FromSeconds(1);
/// <summary>
/// The time when the next purge will occur.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField, AutoNetworkedField]
public TimeSpan NextPurgeTime;
}