mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
21 lines
773 B
C#
21 lines
773 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;
|
|
}
|
|
}
|