using Robust.Shared.GameStates; using Content.Shared.Singularity.EntitySystems; namespace Content.Shared.Singularity.Components; /// /// A component that makes the associated entity destroy other within some distance of itself. /// Also makes the associated entity destroy other entities upon contact. /// Primarily managed by and its server/client versions. /// [RegisterComponent, NetworkedComponent] public sealed class EventHorizonComponent : Component { /// /// The radius of the event horizon within which it will destroy all entities and tiles. /// If < 0.0 this behavior will not be active. /// If you want to set this go through . /// [DataField("radius")] [Access(friends:typeof(SharedEventHorizonSystem))] public float Radius; /// /// Whether the event horizon can consume/destroy the devices built to contain it. /// If you want to set this go through . /// [DataField("canBreachContainment")] [Access(friends:typeof(SharedEventHorizonSystem))] public bool CanBreachContainment = false; /// /// The ID of the fixture used to detect if the event horizon has collided with any physics objects. /// Can be set to null, in which case no such fixture is used. /// If you want to set this go through . /// [DataField("horizonFixtureId")] [Access(friends:typeof(SharedEventHorizonSystem))] public string? HorizonFixtureId = "EventHorizon"; /// /// Whether the entity this event horizon is attached to is being consumed by another event horizon. /// [ViewVariables(VVAccess.ReadOnly)] public bool BeingConsumedByAnotherEventHorizon = false; #region Update Timing /// /// The amount of time that should elapse between this event horizon consuming everything it overlaps with. /// [DataField("consumePeriod")] [ViewVariables(VVAccess.ReadOnly)] [Access(typeof(SharedEventHorizonSystem))] public TimeSpan TargetConsumePeriod { get; set; } = TimeSpan.FromSeconds(0.5); /// /// The last time at which this consumed everything it overlapped with. /// [ViewVariables(VVAccess.ReadOnly)] [Access(typeof(SharedEventHorizonSystem))] public TimeSpan LastConsumeWaveTime { get; set; } = default!; /// /// The next time at which this consumed everything it overlapped with. /// [ViewVariables(VVAccess.ReadOnly)] [Access(typeof(SharedEventHorizonSystem))] public TimeSpan NextConsumeWaveTime { get; set; } = default!; #endregion Update Timing }