mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
19 lines
802 B
C#
19 lines
802 B
C#
using Content.Server.Body.Components;
|
|
using Content.Server.Body.Systems;
|
|
using Content.Shared.EntityConditions;
|
|
using Content.Shared.EntityConditions.Conditions.Body;
|
|
|
|
namespace Content.Server.EntityConditions.Conditions;
|
|
|
|
/// <summary>
|
|
/// Returns true if this entity is both able to breathe and is currently breathing.
|
|
/// </summary>
|
|
/// <inheritdoc cref="EntityConditionSystem{T, TCondition}"/>
|
|
public sealed partial class IsBreathingEntityConditionSystem : EntityConditionSystem<RespiratorComponent, BreathingCondition>
|
|
{
|
|
[Dependency] private RespiratorSystem _respirator = default!;
|
|
protected override void Condition(Entity<RespiratorComponent> entity, ref EntityConditionEvent<BreathingCondition> args)
|
|
{
|
|
args.Result = _respirator.IsBreathing(entity.AsNullable());
|
|
}
|
|
}
|