using Content.Shared._DV.CartridgeLoader.Cartridges;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared._DV.NanoChat;
[RegisterComponent, NetworkedComponent, Access(typeof(SharedNanoChatSystem))]
[AutoGenerateComponentPause, AutoGenerateComponentState]
public sealed partial class NanoChatCardComponent : Component
{
///
/// The number assigned to this card.
///
[DataField, AutoNetworkedField]
public uint? Number;
///
/// Whether a PDA has this card's UI closed.
/// Used for notifications.
///
[DataField]
public bool IsClosed;
///
/// All chat recipients stored on this card.
///
[DataField]
public Dictionary Recipients = [];
///
/// All messages stored on this card, keyed by recipient number.
///
[DataField]
public Dictionary> Messages = [];
///
/// The NanoChat numbers that should not give a notification, even when notifications are enabled.
///
[DataField]
public HashSet MutedChats = [];
///
/// The currently selected chat recipient number.
///
[DataField]
public uint? CurrentChat;
///
/// The maximum amount of recipients this card supports.
///
[DataField]
public int MaxRecipients = 50;
///
/// Last time a message was sent, for rate limiting.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
public TimeSpan LastMessageTime; // TODO: actually use this, compare against actor and not the card
///
/// Whether to send notifications.
///
[DataField]
public bool NotificationsMuted;
///
/// Whether the card's number should be listed in NanoChat's lookup
///
[DataField]
public bool ListNumber = true;
///
/// The PDA that this card is currently inserted to.
///
[DataField]
public EntityUid? PdaUid = null;
}