using Content.Shared.Singularity.Components;
using Content.Server.Singularity.EntitySystems;
namespace Content.Server.Singularity.Components;
///
/// The server-side version of .
/// Primarily managed by .
///
[RegisterComponent, AutoGenerateComponentPause]
public sealed partial class GravityWellComponent : Component
{
///
/// The maximum range at which the gravity well can push/pull entities.
///
[DataField]
public float MaxRange;
///
/// The minimum range at which the gravity well can push/pull entities.
/// This is effectively hardfloored at .
///
[DataField]
public float MinRange = 0f;
///
/// The acceleration entities will experience towards the gravity well at a distance of 1m.
/// Negative values accelerate entities away from the gravity well.
/// Actual acceleration scales with the inverse of the distance to the singularity.
///
[DataField]
public float BaseRadialAcceleration = 0.0f;
///
/// The acceleration entities will experience tangent to the gravity well at a distance of 1m.
/// Positive tangential acceleration is counter-clockwise.
/// Actual acceleration scales with the inverse of the distance to the singularity.
///
[DataField]
public float BaseTangentialAcceleration = 0.0f;
#region Update Timing
///
/// The amount of time that should elapse between automated updates to this gravity well.
///
[DataField("gravPulsePeriod")]
[ViewVariables(VVAccess.ReadOnly)]
[Access(typeof(GravityWellSystem))]
public TimeSpan TargetPulsePeriod { get; internal set; } = TimeSpan.FromSeconds(0.5);
///
/// The next time at which this gravity well should pulse.
///
[DataField, Access(typeof(GravityWellSystem)), AutoPausedField]
public TimeSpan NextPulseTime { get; internal set; } = default!;
///
/// The last time this gravity well pulsed.
///
[ViewVariables(VVAccess.ReadOnly)]
public TimeSpan LastPulseTime => NextPulseTime - TargetPulsePeriod;
#endregion Update Timing
}