using Content.Shared.Access.Systems; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared.Access.Components; /// /// This is used for an ID that expires and replaces its access after a certain period has passed. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause] [Access(typeof(SharedIdCardSystem))] public sealed partial class ExpireIdCardComponent : Component { /// /// Whether this ID has expired yet and had its accesses replaced. /// This is runtime state only. Do not make this a DataField. /// [ViewVariables(VVAccess.ReadOnly)] public bool Expired; /// /// Whether this card will expire at all. /// [ViewVariables] public bool Permanent => ExpireTime == null; /// /// The time at which this card will expire and the access will be removed. /// [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField, AutoNetworkedField] public TimeSpan? ExpireTime; /// /// Access the replaces current access once this card expires. /// [DataField] public HashSet> ExpiredAccess = new(); /// /// Line spoken by the card when it expires. /// [DataField] public LocId? ExpireMessage; }