using Content.Shared.Atmos.Components; using Content.Shared.Atmos.Prototypes; using Content.Shared.Body.Components; using Content.Shared.Body.Systems; using Robust.Shared.Configuration; using Robust.Shared.Prototypes; namespace Content.Shared.Atmos.EntitySystems; public abstract partial class SharedAtmosphereSystem : EntitySystem { [Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] protected readonly IPrototypeManager ProtoMan = default!; [Dependency] private readonly SharedInternalsSystem _internals = default!; [Dependency] protected readonly SharedTransformSystem XformSystem = default!; private EntityQuery _internalsQuery; /// /// The length to pre-allocate list/dicts of delta pressure entities on a . /// public const int DeltaPressurePreAllocateLength = 1000; public override void Initialize() { base.Initialize(); _internalsQuery = GetEntityQuery(); InitializeBreathTool(); InitializeGases(); InitializeCVars(); } /// /// Gets the of a given gas ID. /// /// The gas ID to get the prototype of. /// The of the given gas ID. public GasPrototype GetGas(int gasId) { return GasPrototypes[gasId]; } /// /// Gets the of a given gas ID. /// /// The gas ID to get the prototype of. /// The of the given gas ID. public GasPrototype GetGas(Gas gasId) { return GasPrototypes[(int)gasId]; } /// /// Gets an enumerable of all the s. /// public IEnumerable Gases => GasPrototypes; } /// /// Enum that represents the current processing state of a /// . /// public enum AtmosphereProcessingState : byte { Revalidate, TileEqualize, ActiveTiles, ExcitedGroups, HighPressureDelta, DeltaPressure, Hotspots, Superconductivity, PipeNet, AtmosDevices, NumStates, } /// /// Data on the airtightness of a . /// Cached on the and updated during /// if it was invalidated. /// /// The current directions blocked on this tile. /// This is where air cannot flow to. /// Whether the tile can have air when blocking directions. /// Common for entities like thin windows which only block one face but can still have air in the residing tile. /// If true, Atmospherics will generate air (yes, creating matter from nothing) /// using the adjacent tiles as a seed if the airtightness is removed and the tile has no air. /// This allows stuff like airlocks that void air when becoming airtight to keep opening/closing without /// draining a room by continuously voiding air. public readonly record struct AirtightData( AtmosDirection BlockedDirections, bool NoAirWhenBlocked, bool FixVacuum); /// /// Struct that holds the result of delta pressure damage processing for an entity. /// This is only created and enqueued when the entity needs to take damage. /// /// The entity to deal damage to. /// The current absolute pressure the entity is experiencing. /// The current delta pressure the entity is experiencing. public readonly record struct DeltaPressureDamageResult( Entity Ent, float Pressure, float DeltaPressure);