using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared._DV.Light; /// /// A component that reacts to changes in light levels. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause, Access(typeof(SharedLightReactiveSystem))] public sealed partial class LightReactiveComponent : Component { /// /// The frequency at which the component checks for light level changes. /// There should be very little reason it should be higher than this. /// [DataField] public TimeSpan UpdateFrequency = TimeSpan.FromSeconds(1); /// /// Whether the component should only update while the entity is alive. /// If false, it will update even if the entity is dead. /// [DataField] public bool OnlyWhileAlive = true; /// /// Should this update its light level automatically, or only when asked to by another system? /// If true, it will update its light level automatically. /// If false, it will only update when explicitly requested. /// [DataField] public bool Manual = false; /// /// The next time the component should update. /// [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField, AutoPausedField] public TimeSpan NextUpdate = TimeSpan.Zero; /// /// The current light level of this entity. /// [DataField] public float CurrentLightLevel = 0f; }