Limit atmos device rates (#6533)

This commit is contained in:
Leon Friedrich
2022-03-01 03:39:30 +13:00
committed by GitHub
parent ffed5eec81
commit ee7d0440f3
20 changed files with 220 additions and 116 deletions

View File

@@ -1,10 +1,10 @@
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
using Content.Server.Atmos.Piping.Unary.EntitySystems;
using Content.Shared.Atmos;
namespace Content.Server.Atmos.Piping.Unary.Components
{
[RegisterComponent]
[Friend(typeof(GasOutletInjectorSystem))]
public sealed class GasOutletInjectorComponent : Component
{
@@ -14,12 +14,26 @@ namespace Content.Server.Atmos.Piping.Unary.Components
[ViewVariables(VVAccess.ReadWrite)]
public bool Injecting { get; set; } = false;
/// <summary>
/// Target volume to transfer. If <see cref="WideNet"/> is enabled, actual transfer rate will be much higher.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float VolumeRate { get; set; } = 50f;
public float TransferRate
{
get => _transferRate;
set => _transferRate = Math.Clamp(value, 0f, MaxTransferRate);
}
private float _transferRate = 50;
[ViewVariables(VVAccess.ReadWrite)]
[DataField("maxTransferRate")]
public float MaxTransferRate = Atmospherics.MaxTransferRate;
[DataField("maxPressure")]
public float MaxPressure { get; set; } = 2 * Atmospherics.MaxOutputPressure;
[DataField("inlet")]
public string InletName { get; set; } = "pipe";
// TODO ATMOS: Inject method.
}
}