]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
move SignalState to shared (#37303)
authordeltanedas <39013340+deltanedas@users.noreply.github.com>
Sat, 10 May 2025 00:05:19 +0000 (01:05 +0100)
committerGitHub <noreply@github.com>
Sat, 10 May 2025 00:05:19 +0000 (20:05 -0400)
Co-authored-by: deltanedas <@deltanedas:kde.org>
Content.Server/DeviceLinking/Components/LogicGateComponent.cs
Content.Server/DeviceLinking/Systems/DoorSignalControlSystem.cs
Content.Server/DeviceLinking/Systems/EdgeDetectorSystem.cs
Content.Shared/DeviceLinking/SharedLogicGate.cs

index 61f85934b401ca3e781354c2c83d0bb4cacdb350..c4f6dbd8beac79be0d909062866066af0e5ddd44 100644 (file)
@@ -49,7 +49,7 @@ public sealed partial class LogicGateComponent : Component
     [DataField, ViewVariables(VVAccess.ReadWrite)]
     public ProtoId<SourcePortPrototype> OutputPort = "Output";
 
-    // Initial state
+    // Initial state, used to not spam invoke ports
     [DataField]
     public SignalState StateA = SignalState.Low;
 
@@ -59,13 +59,3 @@ public sealed partial class LogicGateComponent : Component
     [DataField]
     public bool LastOutput;
 }
-
-/// <summary>
-/// Last state of a signal port, used to not spam invoking ports.
-/// </summary>
-public enum SignalState : byte
-{
-    Momentary, // Instantaneous pulse high, compatibility behavior
-    Low,
-    High
-}
index 107559826c0220bfa7afd9cc0645c00db3410812..a70897805818c2034613d00945f464a07ed4ccb7 100644 (file)
@@ -1,6 +1,7 @@
 using Content.Server.DeviceLinking.Components;
 using Content.Server.DeviceNetwork;
 using Content.Server.Doors.Systems;
+using Content.Shared.DeviceLinking;
 using Content.Shared.DeviceLinking.Events;
 using Content.Shared.DeviceNetwork;
 using Content.Shared.Doors.Components;
index a425122df41734a225368a6209c7c385ec505d54..16fc98e07d5ef6c1e80e565aa33e5c54ae708f62 100644 (file)
@@ -1,4 +1,5 @@
 using Content.Server.DeviceLinking.Components;
+using Content.Shared.DeviceLinking;
 using Content.Shared.DeviceLinking.Events;
 using Content.Shared.DeviceNetwork;
 
index 75f8cb4951c0fad01ec6f68c4e49d56096bd8253..35d3f9e6f12f20257e7aa84c6e4d5f3e09116a46 100644 (file)
@@ -40,3 +40,15 @@ public enum LogicGateLayers : byte
     InputB,
     Output
 }
+
+/// <summary>
+/// The possible states of a logic-capable signal.
+/// Stored in network payload data of device network messages.
+/// </summary>
+[Serializable, NetSerializable]
+public enum SignalState : byte
+{
+    Momentary, // Instantaneous pulse high, compatibility behavior
+    Low,
+    High
+}