2022-04-04 01:13:03 -05:00
|
|
|
using Content.Server.MachineLinking.System;
|
2020-08-29 03:33:42 -07:00
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.MachineLinking.Components
|
2020-08-29 03:33:42 -07:00
|
|
|
{
|
2022-04-04 01:13:03 -05:00
|
|
|
[DataDefinition]
|
2023-05-07 08:07:24 +02:00
|
|
|
public readonly struct PortIdentifier
|
2022-04-04 01:13:03 -05:00
|
|
|
{
|
|
|
|
|
[DataField("uid")]
|
2023-05-07 08:07:24 +02:00
|
|
|
public readonly EntityUid Uid;
|
2022-04-04 01:13:03 -05:00
|
|
|
|
|
|
|
|
[DataField("port")]
|
2023-05-07 08:07:24 +02:00
|
|
|
public readonly string Port;
|
2022-04-04 01:13:03 -05:00
|
|
|
|
|
|
|
|
public PortIdentifier(EntityUid uid, string port)
|
|
|
|
|
{
|
|
|
|
|
Uid = uid;
|
|
|
|
|
Port = port;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-29 03:33:42 -07:00
|
|
|
[RegisterComponent]
|
2022-06-07 15:26:28 +02:00
|
|
|
[Access(typeof(SignalLinkerSystem))]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class SignalTransmitterComponent : Component
|
2020-08-29 03:33:42 -07:00
|
|
|
{
|
2022-04-04 01:13:03 -05:00
|
|
|
/// <summary>
|
|
|
|
|
/// How far the device can transmit a signal wirelessly.
|
|
|
|
|
/// Devices farther than this range can still transmit if they are
|
|
|
|
|
/// on the same powernet.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("transmissionRange")]
|
2022-05-25 12:52:15 +12:00
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2022-04-04 01:13:03 -05:00
|
|
|
public float TransmissionRange = 30f;
|
|
|
|
|
|
2021-08-27 17:46:02 +02:00
|
|
|
[DataField("outputs")]
|
2022-06-07 15:26:28 +02:00
|
|
|
[Access(typeof(SignalLinkerSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends
|
2022-05-12 20:46:20 +12:00
|
|
|
public Dictionary<string, List<PortIdentifier>> Outputs = new();
|
2020-08-29 03:33:42 -07:00
|
|
|
}
|
|
|
|
|
}
|