Files
tbd-station-14/Content.Server/MachineLinking/Components/SignalLinkerComponent.cs
Kevin Zheng 4e5adc2b86 Add interlocking airlocks (#14177)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2023-05-07 16:49:11 +10:00

36 lines
1.1 KiB
C#

using Content.Shared.Tools;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Utility;
namespace Content.Server.MachineLinking.Components
{
[RegisterComponent]
public sealed class SignalLinkerComponent : Component
{
[ViewVariables]
public EntityUid? SavedTransmitter;
[ViewVariables]
public EntityUid? SavedReceiver;
/// <summary>
/// Optional tool quality required for linker to work.
/// If linker entity doesn't have this quality it will ignore any interaction.
/// </summary>
[DataField("requiredQuality", customTypeSerializer: typeof(PrototypeIdSerializer<ToolQualityPrototype>))]
[ViewVariables(VVAccess.ReadWrite)]
public string? RequiredQuality;
// Utility functions below to deal with linking entities with both Transmit and Receive components.
public bool LinkTX()
{
return SavedTransmitter == null;
}
public bool LinkRX()
{
return SavedTransmitter != null && SavedReceiver == null;
}
}
}