1
0

NetworkConfiguratorUserInterfaceState.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using Content.Shared.DeviceLinking;
  2. using Robust.Shared.Prototypes;
  3. using Robust.Shared.Serialization;
  4. namespace Content.Shared.DeviceNetwork;
  5. [Serializable, NetSerializable]
  6. public sealed class NetworkConfiguratorUserInterfaceState : BoundUserInterfaceState
  7. {
  8. public readonly HashSet<(string address, string name)> DeviceList;
  9. public NetworkConfiguratorUserInterfaceState(HashSet<(string, string)> deviceList)
  10. {
  11. DeviceList = deviceList;
  12. }
  13. }
  14. [Serializable, NetSerializable]
  15. public sealed class DeviceListUserInterfaceState : BoundUserInterfaceState
  16. {
  17. public readonly HashSet<(string address, string name)> DeviceList;
  18. public DeviceListUserInterfaceState(HashSet<(string address, string name)> deviceList)
  19. {
  20. DeviceList = deviceList;
  21. }
  22. }
  23. [Serializable, NetSerializable]
  24. public sealed class DeviceLinkUserInterfaceState : BoundUserInterfaceState
  25. {
  26. public readonly List<SourcePortPrototype> Sources;
  27. public readonly List<SinkPortPrototype> Sinks;
  28. public readonly HashSet<(ProtoId<SourcePortPrototype> source, ProtoId<SinkPortPrototype> sink)> Links;
  29. public readonly List<(string source, string sink)>? Defaults;
  30. public readonly string SourceAddress;
  31. public readonly string SinkAddress;
  32. public DeviceLinkUserInterfaceState(
  33. List<SourcePortPrototype> sources,
  34. List<SinkPortPrototype> sinks,
  35. HashSet<(ProtoId<SourcePortPrototype> source, ProtoId<SinkPortPrototype> sink)> links,
  36. string sourceAddress,
  37. string sinkAddress,
  38. List<(string source, string sink)>? defaults = default)
  39. {
  40. Links = links;
  41. SourceAddress = sourceAddress;
  42. SinkAddress = sinkAddress;
  43. Defaults = defaults;
  44. Sources = sources;
  45. Sinks = sinks;
  46. }
  47. }