using Content.Server.Radio.EntitySystems;
using Content.Shared.Radio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Radio.Components;
///
/// Component for attempting to post radio message to chat
/// upon something destructive happens to device.
/// Can be used for singularity containment field emitters
/// or other crucial parts of infrastructure.
///
[RegisterComponent, AutoGenerateComponentPause]
[Access(typeof(NotifyOnNonFunctioningSystem))]
public sealed partial class NotifyOnNonFunctioningComponent : Component
{
///
/// The radio channel to broadcast on when something happens to this device
///
[DataField(required: true)]
public ProtoId RadioChannel;
///
/// Localized string to use when this device is destroyed.
///
[DataField]
public LocId? LocDestroyed;
///
/// Localized string to use when this device is deconstructed.
///
[DataField]
public LocId? LocDeconstructed;
///
/// Localized string to use when this device is unlocked.
///
[DataField]
public LocId? LocUnlocked;
///
/// Localized string to use when this device have
/// no power supply to keep working.
///
[DataField]
public LocId? LocUnpowered;
///
/// Localized string to use when this device is turned off.
///
[DataField]
public LocId? LocTurnedOff;
///
/// Localized string to use when this device is unanchored
/// (and is most likely is not able to function).
///
[DataField]
public LocId? LocUnanchored;
///
/// The next time that this device can send a radio message.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
public TimeSpan NextMessage;
///
/// The minimum amount of time between sending consecutive messages.
///
[DataField]
public TimeSpan NextMessageDelay = TimeSpan.FromSeconds(10);
///
/// Marker, if power is required to send radio message.
///
[DataField]
public bool RequirePowered;
}