Layering for atmospheric pipes (#36124)
Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com> Co-authored-by: Kevin Zheng <kevinz5000@gmail.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
using Content.Shared.Atmos.Components;
|
||||
|
||||
namespace Content.Shared.Atmos.EntitySystems;
|
||||
|
||||
public abstract partial class SharedAtmosPipeAppearanceSystem : EntitySystem
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the max number of pipe layers supported by a entity.
|
||||
/// </summary>
|
||||
/// <param name="uid">The entity being checked.</param>
|
||||
/// <param name="atmosPipeLayers">The entity's <see cref="AtmosPipeLayersComponent"/>, if available.</param>
|
||||
/// <returns>Returns <see cref="AtmosPipeLayersComponent.NumberOfPipeLayers"/>
|
||||
/// if the entity has the component, or 1 if it does not.</returns>
|
||||
protected int GetNumberOfPipeLayers(EntityUid uid, out AtmosPipeLayersComponent? atmosPipeLayers)
|
||||
{
|
||||
return TryComp(uid, out atmosPipeLayers) ? atmosPipeLayers.NumberOfPipeLayers : 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user