Files
OldThink/Content.Server/MachineLinking/Components/SignalTransmitterComponent.cs

39 lines
1.1 KiB
C#
Raw Normal View History

2022-04-04 01:13:03 -05:00
using Content.Server.MachineLinking.System;
2021-06-09 22:19:39 +02:00
namespace Content.Server.MachineLinking.Components
{
2022-04-04 01:13:03 -05:00
[DataDefinition]
public readonly struct PortIdentifier
2022-04-04 01:13:03 -05:00
{
[DataField("uid")]
public readonly EntityUid Uid;
2022-04-04 01:13:03 -05:00
[DataField("port")]
public readonly string Port;
2022-04-04 01:13:03 -05:00
public PortIdentifier(EntityUid uid, string port)
{
Uid = uid;
Port = port;
}
}
[RegisterComponent]
[Access(typeof(SignalLinkerSystem))]
public sealed class SignalTransmitterComponent : Component
{
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")]
[ViewVariables(VVAccess.ReadWrite)]
2022-04-04 01:13:03 -05:00
public float TransmissionRange = 30f;
[DataField("outputs")]
[Access(typeof(SignalLinkerSystem), Other = AccessPermissions.ReadExecute)] // FIXME Friends
public Dictionary<string, List<PortIdentifier>> Outputs = new();
}
}