make linking logic gates 1000% better (#25041)

* make door status use SendSignal

* LastSignals and logic, add ClearSignal api too

* make everything outputting a logic signal default to false

* refactor ops

* :trollface:

* :trollface:

* protoid for LastSignals

* oop

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2024-02-12 06:45:51 +00:00
committed by GitHub
parent 16b56c7f45
commit f41ece37c3
12 changed files with 146 additions and 68 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.DeviceLinking;
using Content.Shared.DeviceLinking;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.DeviceNetwork;
@@ -30,12 +31,18 @@ public sealed class DeviceLinkUserInterfaceState : BoundUserInterfaceState
{
public readonly List<SourcePortPrototype> Sources;
public readonly List<SinkPortPrototype> Sinks;
public readonly HashSet<(string source, string sink)> Links;
public readonly HashSet<(ProtoId<SourcePortPrototype> source, ProtoId<SinkPortPrototype> sink)> Links;
public readonly List<(string source, string sink)>? Defaults;
public readonly string SourceAddress;
public readonly string SinkAddress;
public DeviceLinkUserInterfaceState(List<SourcePortPrototype> sources, List<SinkPortPrototype> sinks, HashSet<(string source, string sink)> links, string sourceAddress, string sinkAddress, List<(string source, string sink)>? defaults = default)
public DeviceLinkUserInterfaceState(
List<SourcePortPrototype> sources,
List<SinkPortPrototype> sinks,
HashSet<(ProtoId<SourcePortPrototype> source, ProtoId<SinkPortPrototype> sink)> links,
string sourceAddress,
string sinkAddress,
List<(string source, string sink)>? defaults = default)
{
Links = links;
SourceAddress = sourceAddress;