using Robust.Shared.GameStates;
using Content.Shared.Singularity.EntitySystems;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
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.
///
[Access(friends: typeof(SharedEventHorizonSystem))]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
public sealed partial 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")]
public float Radius;
///
/// involves periodically destroying tiles within a specified radius
///
[DataField]
public bool ConsumeTiles = true;
///
/// involves periodically destroying entities within a specified radius. Does not affect collide destruction of entities.
///
[DataField]
public bool ConsumeEntities = true;
///
/// Whether the event horizon can consume/destroy the devices built to contain it.
/// If you want to set this go through .
///
[DataField("canBreachContainment")]
[ViewVariables(VVAccess.ReadWrite)]
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("consumerFixtureId")]
[ViewVariables(VVAccess.ReadWrite)]
public string? ConsumerFixtureId = "EventHorizonConsumer";
///
/// 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("colliderFixtureId")]
[ViewVariables(VVAccess.ReadWrite)]
public string? ColliderFixtureId = "EventHorizonCollider";
///
/// 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.ReadWrite)]
public TimeSpan TargetConsumePeriod = TimeSpan.FromSeconds(0.5);
///
/// The next time at which this consumed everything it overlapped with.
///
[ViewVariables(VVAccess.ReadOnly), DataField("nextConsumeWaveTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextConsumeWaveTime;
#endregion Update Timing
}