2023-05-07 08:07:24 +02:00
using Content.Shared.DeviceLinking ;
using Content.Shared.DeviceNetwork.Systems ;
2022-07-29 14:13:12 +12:00
using Robust.Shared.Audio ;
2022-09-05 17:55:44 -07:00
using Robust.Shared.GameStates ;
2023-05-07 08:07:24 +02:00
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom ;
2022-06-10 03:28:24 +02:00
2023-05-07 08:07:24 +02:00
namespace Content.Shared.DeviceNetwork.Components ;
2022-06-10 03:28:24 +02:00
2023-09-28 16:20:29 -07:00
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
2022-09-05 17:55:44 -07:00
[Access(typeof(SharedNetworkConfiguratorSystem))]
2023-08-22 18:14:33 -07:00
public sealed partial class NetworkConfiguratorComponent : Component
2022-06-10 03:28:24 +02:00
{
2023-12-21 23:18:40 -05:00
// AAAAA ALL OF THESE FAA
2023-05-07 08:07:24 +02:00
/// <summary>
/// Determines whether the configurator is in linking mode or list mode
/// </summary>
2023-09-28 16:20:29 -07:00
[DataField, AutoNetworkedField]
2023-05-07 08:07:24 +02:00
[ViewVariables(VVAccess.ReadWrite)]
2023-05-07 12:58:12 +02:00
public bool LinkModeActive = true ;
2023-05-07 08:07:24 +02:00
2022-06-10 03:28:24 +02:00
/// <summary>
/// The entity containing a <see cref="DeviceListComponent"/> this configurator is currently interacting with
/// </summary>
2023-09-28 16:20:29 -07:00
[DataField, AutoNetworkedField]
2023-12-21 23:18:40 -05:00
public EntityUid ? ActiveDeviceList { get ; set ; }
2022-06-10 03:28:24 +02:00
2022-09-05 17:55:44 -07:00
/// <summary>
2023-05-07 08:07:24 +02:00
/// The entity containing a <see cref="DeviceLinkSourceComponent"/> or <see cref="DeviceLinkSinkComponent"/> this configurator is currently interacting with.<br/>
/// If this is set the configurator is in linking mode.
/// </summary>
2023-12-21 23:18:40 -05:00
// TODO handle device deletion
2023-09-28 16:20:29 -07:00
public EntityUid ? ActiveDeviceLink ;
2023-05-07 08:07:24 +02:00
/// <summary>
/// The target device this configurator is currently linking with the <see cref="ActiveDeviceLink"/>
/// </summary>
2023-12-21 23:18:40 -05:00
// TODO handle device deletion
2023-09-28 16:20:29 -07:00
public EntityUid ? DeviceLinkTarget ;
2023-05-07 08:07:24 +02:00
/// <summary>
/// The list of devices stored in the configurator
2022-09-05 17:55:44 -07:00
/// </summary>
2023-09-28 16:20:29 -07:00
[DataField]
2022-09-05 17:55:44 -07:00
public Dictionary < string , EntityUid > Devices = new ( ) ;
2023-09-28 16:20:29 -07:00
[DataField]
2023-05-07 08:07:24 +02:00
[ViewVariables(VVAccess.ReadWrite)]
public TimeSpan UseDelay = TimeSpan . FromSeconds ( 0.5 ) ;
2023-09-28 16:20:29 -07:00
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
2023-05-07 08:07:24 +02:00
[ViewVariables(VVAccess.ReadWrite)]
public TimeSpan LastUseAttempt ;
2023-09-28 16:20:29 -07:00
[DataField]
2022-06-10 03:28:24 +02:00
public SoundSpecifier SoundNoAccess = new SoundPathSpecifier ( "/Audio/Machines/custom_deny.ogg" ) ;
2023-05-07 08:07:24 +02:00
2023-09-28 16:20:29 -07:00
[DataField]
2023-05-22 15:20:53 +02:00
public SoundSpecifier SoundSwitchMode = new SoundPathSpecifier ( "/Audio/Machines/quickbeep.ogg" ) ;
2022-06-10 03:28:24 +02:00
}