CatStation/Content.Shared/Radiation/Systems/SharedRadiationSystem.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

21 lines
776 B
C#

using Content.Shared.Radiation.Components;
namespace Content.Shared.Radiation.Systems;
public abstract partial class SharedRadiationSystem : EntitySystem
{
[Dependency] protected EntityQuery<RadiationSourceComponent> SourceQuery = default!;
/// <summary>
/// Sets the intensity of a <see cref="RadiationSourceComponent"/> to the passed intensity.
/// </summary>
/// <param name="entity">Radiation source we're attempting to update</param>
/// <param name="intensity">Intensity we're setting the source to.</param>
public void SetIntensity(Entity<RadiationSourceComponent?> entity, float intensity)
{
if (!SourceQuery.Resolve(entity, ref entity.Comp, false))
return;
entity.Comp.Intensity = intensity;
}
}