using System.Diagnostics.CodeAnalysis;
using JetBrains.Annotations;
namespace Content.Shared.Atmos.EntitySystems;
public abstract partial class SharedAtmosphereSystem
{
///
/// Merges a given into this entity's containing .
///
/// Entity who's containing
/// we're merging a given into.
/// The gas
/// we're merging into the containing
/// Whether we should ignore non-tile s.
/// Whether we should excite the gas upon merging.
[PublicAPI]
public virtual void MergeContainingMixture(Entity entity, GasMixture mixture, bool ignoreExposed = false, bool excite = false)
{
// Handled by server
}
///
/// Merges a given gas into this entity's tile .
///
/// Entity who's containing
/// we're merging a given into.
/// The gas
/// we're merging into the containing .
/// Whether we should excite the gas upon merging.
[PublicAPI]
public virtual void MergeTileMixture(Entity entity, GasMixture mixture, bool excite = false)
{
// Handled by server
}
///
/// Adjusts a given gas in this entity's containing .
///
/// Entity who's containing
/// we're merging a given into.
/// The gas in our given we're adjusting the mols of.
/// The amount of mols we're adjusting the gas by.
/// Whether we should ignore non-tile s.
/// Whether we should excite the gas upon merging.
[PublicAPI]
public virtual void AdjustContainingMixture(Entity entity, Gas gas, float mols, bool ignoreExposed = false, bool excite = false)
{
// Handled by server
}
///
/// Adjusts a given gas in this entity's tile .
///
/// Entity who's containing
/// we're merging a given into.
/// The gas in our given we're adjusting the mols of.
/// The amount of mols we're adjusting the gas by.
/// Whether we should excite the gas upon merging.
[PublicAPI]
public virtual void AdjustTileMixture(Entity entity, Gas gas, float mols, bool excite = false)
{
// Handled by server
}
///
/// Tries to get the of a containing entity (ex. lockers and cryopods),
/// does not return tile s.
///
/// Exposed entity that is in some .
/// The found gas .
/// Returns true if this entity is in an exposed , false otherwise.
[PublicAPI]
public bool TryGetExposedMixture(Entity entity, [NotNullWhen(true)] out GasMixture? mixture)
{
mixture = null;
if (!Resolve(entity, ref entity.Comp) || entity.Comp.Anchored)
return false;
// TODO ATMOS: recursively iterate up through parents
// This really needs recursive InContainer metadata flag for performance
// And ideally some fast way to get the innermost airtight container.
var ev = new AtmosExposedGetAirEvent((entity, entity.Comp));
RaiseLocalEvent(entity, ref ev);
mixture = ev.Gas;
return ev.Handled;
}
}