using Content.Shared.Medical.SuitSensor;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Medical.SuitSensors;
///
/// Tracking device, embedded in almost all uniforms and jumpsuits.
/// If enabled, will report to crew monitoring console owners position and status.
///
[RegisterComponent, AutoGenerateComponentPause]
[Access(typeof(SuitSensorSystem))]
public sealed partial class SuitSensorComponent : Component
{
///
/// Choose a random sensor mode when item is spawned.
///
[DataField]
public bool RandomMode = true;
///
/// If true user can't change suit sensor mode
///
[DataField]
public bool ControlsLocked = false;
///
/// How much time it takes to change another player's sensors
///
[DataField]
public float SensorsTime = 1.75f;
///
/// Current sensor mode. Can be switched by user verbs.
///
[DataField]
public SuitSensorMode Mode = SuitSensorMode.SensorOff;
///
/// Activate sensor if user wear it in this slot.
///
[DataField]
public string ActivationSlot = "jumpsuit";
///
/// Activate sensor if user has this in a sensor-compatible container.
///
[DataField]
public string? ActivationContainer;
///
/// How often does sensor update its owners status (in seconds). Limited by the system update rate.
///
[DataField]
public TimeSpan UpdateRate = TimeSpan.FromSeconds(2f);
///
/// Current user that wears suit sensor. Null if nobody wearing it.
///
[ViewVariables]
public EntityUid? User = null;
///
/// Next time when sensor updated owners status
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextUpdate = TimeSpan.Zero;
///
/// The station this suit sensor belongs to. If it's null the suit didn't spawn on a station and the sensor doesn't work.
///
[DataField("station")]
public EntityUid? StationId = null;
///
/// The server the suit sensor sends it state to.
/// The suit sensor will try connecting to a new server when no server is connected.
/// It does this by calling the servers entity system for performance reasons.
///
[DataField("server")]
public string? ConnectedServer = null;
///
/// The previous mode of the suit. This is used to restore the state when an EMP effect ends.
///
[DataField, ViewVariables]
public SuitSensorMode PreviousMode = SuitSensorMode.SensorOff;
///
/// The previous locked status of the controls. This is used to restore the state when an EMP effect ends.
/// This keeps prisoner jumpsuits/internal implants from becoming unlocked after an EMP.
///
[DataField, ViewVariables]
public bool PreviousControlsLocked = false;
}