Machine Linking Overhaul (#7160)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Server.MachineLinking.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
public sealed class DoorSignalControlComponent : Component
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,9 @@ namespace Content.Server.MachineLinking.Components
|
||||
public sealed class SignalLinkerComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
public (SignalTransmitterComponent transmitter, string port)? Port;
|
||||
public EntityUid? savedTransmitter;
|
||||
|
||||
[ViewVariables]
|
||||
public EntityUid? savedReceiver;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.MachineLinking.Models;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
@@ -11,9 +10,14 @@ namespace Content.Server.MachineLinking.Components
|
||||
public sealed class SignalReceiverComponent : Component
|
||||
{
|
||||
[DataField("inputs")]
|
||||
private List<SignalPort> _inputs = new();
|
||||
private Dictionary<string, List<PortIdentifier>> _inputs = new();
|
||||
|
||||
public void AddPort(string name)
|
||||
{
|
||||
_inputs.Add(name, new());
|
||||
}
|
||||
|
||||
[ViewVariables]
|
||||
public IReadOnlyList<SignalPort> Inputs => _inputs;
|
||||
public IReadOnlyDictionary<string, List<PortIdentifier>> Inputs => _inputs;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.MachineLinking.Models;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
using Content.Server.MachineLinking.System;
|
||||
|
||||
namespace Content.Server.MachineLinking.Components
|
||||
{
|
||||
[DataDefinition]
|
||||
public struct PortIdentifier
|
||||
{
|
||||
[DataField("uid")]
|
||||
public EntityUid Uid;
|
||||
|
||||
[DataField("port")]
|
||||
public string Port;
|
||||
|
||||
public PortIdentifier(EntityUid uid, string port)
|
||||
{
|
||||
Uid = uid;
|
||||
Port = port;
|
||||
}
|
||||
}
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed class SignalTransmitterComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// How far the device can transmit a signal wirelessly.
|
||||
/// Devices farther than this range can still transmit if they are
|
||||
/// on the same powernet.
|
||||
/// </summary>
|
||||
[DataField("transmissionRange")]
|
||||
public float TransmissionRange = 30f;
|
||||
|
||||
[DataField("outputs")]
|
||||
private List<SignalPort> _outputs = new();
|
||||
private Dictionary<string, List<PortIdentifier>> _outputs = new();
|
||||
|
||||
[ViewVariables]
|
||||
public IReadOnlyList<SignalPort> Outputs => _outputs;
|
||||
public IReadOnlyDictionary<string, List<PortIdentifier>> Outputs => _outputs;
|
||||
|
||||
public void AddPort(string name)
|
||||
{
|
||||
_outputs.Add(name, new());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Server.MachineLinking.Components
|
||||
[RegisterComponent]
|
||||
public sealed class TwoWayLeverComponent : Component
|
||||
{
|
||||
public TwoWayLeverSignal State;
|
||||
public TwoWayLeverState State;
|
||||
|
||||
public bool NextSignalLeft;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user