using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server._DV.AiDetector;
///
/// Changes an appearance data string depending on distance to any AiDetectable entities.
///
[RegisterComponent, Access(typeof(AiDetectorSystem))]
public sealed partial class AiDetectorComponent : Component
{
///
/// The string to use for appearance data when there is no AI nearby.
///
[DataField]
public string Default = "none";
///
/// Each range and state to use.
/// The first one found is used, so have the shortest range first.
///
[DataField(required: true)]
public List Ranges = new();
///
/// The state currently shown.
///
[DataField]
public string State = string.Empty;
///
/// How long to wait between updates.
///
[DataField]
public TimeSpan UpdateDelay = TimeSpan.FromSeconds(0.5);
///
/// When to next update state.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan NextUpdate = TimeSpan.Zero;
}
[DataRecord]
public partial record struct AiDetectorRange(string State = "", float Range = 0f);