Gas pipe sensors (#33128)

* Initial commit

* Monitored pipe node is now referenced by name

* Review changes

* Simplified construction

* Tweaked deconstruction to match other binary atmos devices

* Helper function removal

* Updated attribution
This commit is contained in:
chromiumboy
2024-11-21 21:46:10 -06:00
committed by GitHub
parent 38c70d6c9b
commit 403528cbf3
11 changed files with 196 additions and 2 deletions

View File

@@ -48,7 +48,9 @@ public sealed partial class AtmosMonitorComponent : Component
[DataField("gasThresholds")]
public Dictionary<Gas, AtmosAlarmThreshold>? GasThresholds;
// Stores a reference to the gas on the tile this is on.
/// <summary>
/// Stores a reference to the gas on the tile this entity is on (or the pipe network it monitors; see <see cref="MonitorsPipeNet"/>).
/// </summary>
[ViewVariables]
public GasMixture? TileGas;
@@ -65,4 +67,19 @@ public sealed partial class AtmosMonitorComponent : Component
/// </summary>
[DataField("registeredDevices")]
public HashSet<string> RegisteredDevices = new();
/// <summary>
/// Specifies whether this device monitors its own internal pipe network rather than the surrounding atmosphere.
/// </summary>
/// <remarks>
/// If 'true', the entity will require a NodeContainerComponent with one or more PipeNodes to function.
/// </remarks>
[DataField]
public bool MonitorsPipeNet = false;
/// <summary>
/// Specifies the name of the pipe node that this device is monitoring.
/// </summary>
[DataField]
public string NodeNameMonitoredPipe = "monitored";
}