using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.DeviceLinking;
[RegisterComponent]
[NetworkedComponent] // for interactions. Actual state isn't currently synced.
[Access(typeof(SharedDeviceLinkSystem))]
public sealed partial class DeviceLinkSourceComponent : Component
{
/// <summary>
/// The ports the device link source sends signals from
/// </summary>
[DataField]
public HashSet<ProtoId<SourcePortPrototype>>? Ports;
/// A list of sink uids that got linked for each port
[ViewVariables]
public Dictionary<ProtoId<SourcePortPrototype>, HashSet<EntityUid>> Outputs = new();
/// If set to High or Low, the last signal state for a given port.
/// Used when linking ports of devices that are currently outputting a signal.
/// Only set by <c>DeviceLinkSystem.SendSignal</c>.
public Dictionary<ProtoId<SourcePortPrototype>, bool> LastSignals = new();
/// The list of source to sink ports for each linked sink entity for easier managing of links
public Dictionary<EntityUid, HashSet<(ProtoId<SourcePortPrototype> source, ProtoId<SinkPortPrototype> sink)>> LinkedPorts = new();
/// Limits the range devices can be linked across.
public float Range = 30f;
}