using Content.Shared.DeviceNetwork.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.DeviceNetwork.Components;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedDeviceNetworkSystem), typeof(DeviceNet))]
public sealed partial class DeviceNetworkComponent : Component
{
///
/// Default device network ID to connect to.
///
[DataField("deviceNetId")]
public DeviceNetIdDefaults NetIdEnum { get; set; }
public int DeviceNetId => (int) NetIdEnum;
///
/// The frequency that this device is listening on.
///
[DataField]
public uint? ReceiveFrequency;
///
/// The address ID of the device, either on the network it is currently connected to or whatever address it
/// most recently used.
///
[DataField]
public string Address = string.Empty;
///
/// Whether the device should listen for all device messages, regardless of the intended recipient.
///
[DataField]
public bool ReceiveAll;
///
/// The frequency that this device going to try to transmit on.
///
[DataField]
public uint? TransmitFrequency;
///
/// Frequency prototype, used to select a default frequency to listen to on.
///
[DataField]
public ProtoId? ReceiveFrequencyId;
///
/// Frequency prototype, used to select a default frequency to transmit on.
///
[DataField]
public ProtoId? TransmitFrequencyId;
///
/// Whether to send the broadcast recipients list to the sender so it can be filtered.
///
[DataField]
public bool SendBroadcastAttemptEvent;
///
/// If the device should show its address upon an examine.
/// Useful for devices that do not have a visible UI.
///
[DataField, AutoNetworkedField]
public bool ExaminableAddress;
///
/// Prefix to prepend to any automatically generated addresses. Helps players to identify devices.
///
[DataField]
public LocId? Prefix;
///
/// Whether the device should attempt to join the network on map init.
///
[DataField]
public bool AutoConnect = true;
///
/// Whether this device's address can be saved to device-lists
///
[DataField]
public bool SavableAddress = true;
///
/// If true, the address was customized and should be preserved across networks. If false, a randomly
/// generated address will be created whenever this device connects to a network.
///
[DataField]
public bool CustomAddress;
///
/// A list of device-lists that this device is on.
///
[DataField]
[Access(typeof(SharedDeviceListSystem))]
public HashSet DeviceLists = new();
///
/// A list of configurators that this device is on.
///
[DataField]
[Access(typeof(SharedNetworkConfiguratorSystem))]
public HashSet Configurators = new();
}