CatStation/Content.Server/EntityConditions/Conditions/BreathingEntityConditionSystem.cs
Pieter-Jan Briers 5168b5f3d4
IoC source gen compatibility (#43863)
* 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
2026-05-09 03:29:58 +00:00

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());
}
}