2023-05-06 22:49:11 -08:00
|
|
|
using Content.Server.MachineLinking.Events;
|
|
|
|
|
|
2023-05-12 00:16:02 +02:00
|
|
|
namespace Content.Server.DeviceLinking.Components;
|
2023-05-06 22:49:11 -08:00
|
|
|
|
|
|
|
|
[RegisterComponent]
|
|
|
|
|
public sealed class OrGateComponent : Component
|
|
|
|
|
{
|
|
|
|
|
// Initial state
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
public SignalState StateA1 = SignalState.Low;
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
public SignalState StateB1 = SignalState.Low;
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
public SignalState LastO1 = SignalState.Low;
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
public SignalState StateA2 = SignalState.Low;
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
public SignalState StateB2 = SignalState.Low;
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
public SignalState LastO2 = SignalState.Low;
|
|
|
|
|
}
|
2023-05-12 00:16:02 +02:00
|
|
|
|
|
|
|
|
public enum SignalState
|
|
|
|
|
{
|
|
|
|
|
Momentary, // Instantaneous pulse high, compatibility behavior
|
|
|
|
|
Low,
|
|
|
|
|
High
|
|
|
|
|
}
|
|
|
|
|
|