using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.PDA.Ringer;
[RegisterComponent, NetworkedComponent, Access(typeof(SharedRingerSystem))]
[AutoGenerateComponentState(true, fieldDeltas: true), AutoGenerateComponentPause]
public sealed partial class RingerComponent : Component
{
///
/// The ringtone, represented as an array of notes.
///
[DataField, AutoNetworkedField]
public Note[] Ringtone = new Note[SharedRingerSystem.RingtoneLength];
///
/// The last time this ringer's ringtone was set.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField, AutoNetworkedField]
public TimeSpan NextRingtoneSetTime;
///
/// The time when the next note should play.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField, AutoNetworkedField]
public TimeSpan? NextNoteTime;
///
/// The cooldown before the ringtone can be changed again.
///
[DataField]
public TimeSpan Cooldown = TimeSpan.FromMilliseconds(250);
///
/// Keeps track of how many notes have elapsed if the ringer component is playing.
///
[DataField, AutoNetworkedField]
public int NoteCount;
///
/// How far the sound projects in metres.
///
[DataField, AutoNetworkedField]
public float Range = 3f;
///
/// The ringtone volume.
///
[DataField, AutoNetworkedField]
public float Volume = -4f;
///
/// Whether the ringer is currently playing its ringtone.
///
[DataField, AutoNetworkedField]
public bool Active;
}