Files
tbd-station-14/Content.Server/Fluids/Components/FluidMapDataComponent.cs
Ygg01 75ea093d78 Fluid spread refactor (#11908)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Fix undefined
2022-11-15 22:30:59 +11:00

36 lines
1.2 KiB
C#

using Content.Server.Fluids.EntitySystems;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Fluids.Components;
[RegisterComponent]
[Access(typeof(FluidSpreaderSystem))]
public sealed class FluidMapDataComponent : Component
{
/// <summary>
/// At what time will <see cref="FluidSpreaderSystem"/> be checked next
/// </summary>
[DataField("goalTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
public TimeSpan GoalTime;
/// <summary>
/// Delay between two runs of <see cref="FluidSpreaderSystem"/>
/// </summary>
[DataField("delay")]
public TimeSpan Delay = TimeSpan.FromSeconds(2);
/// <summary>
/// Puddles to be expanded.
/// </summary>
[DataField("puddles")] public HashSet<EntityUid> Puddles = new();
/// <summary>
/// Convenience method for setting GoalTime to <paramref name="start"/> + <see cref="Delay"/>
/// </summary>
/// <param name="start">Time to which to add <see cref="Delay"/>, defaults to current <see cref="GoalTime"/></param>
public void UpdateGoal(TimeSpan? start = null)
{
GoalTime = (start ?? GoalTime) + Delay;
}
}