Files
tbd-station-14/Content.Server/Power/Generator/GeneratorSignalControlComponent.cs
SpeltIncorrectyl 5d2ddc0d8b Adds signal control to portable generators (#24157)
* added signal control to portable generators

* added documentation

* Discard changes to Content.Server/Radio/EntitySystems/HeadsetSystem.cs

* added DeviceNetworkComponent and WirelessNetworkConnectionComponent to generator prototype

* made GeneratorSignalControlComponent nicer

* implemented auto-revving

* added back necessary dependency

* can't send do-after event manually

* repeat now works with auto revving

* fixed

* removed vv

* stopping generating when it is revving now makes it stop revving

* Update Content.Shared/Power/Generator/ActiveGeneratorRevvingComponent.cs

Co-authored-by: Kara <lunarautomaton6@gmail.com>

* used resolve instead of TryComp

---------

Co-authored-by: Julian Giebel <juliangiebel@live.de>
Co-authored-by: Kara <lunarautomaton6@gmail.com>
2024-01-29 15:56:29 +01:00

30 lines
921 B
C#

using Content.Shared.DeviceLinking;
using Robust.Shared.Prototypes;
namespace Content.Server.Power.Generator;
/// <summary>
/// When attached to an entity with <see cref="FuelGeneratorComponent"/> it will allow the signal network to exert control over the generator.
/// </summary>
[RegisterComponent]
public sealed partial class GeneratorSignalControlComponent: Component
{
/// <summary>
/// The port that should be invoked when turning the generator on.
/// </summary>
[DataField]
public ProtoId<SinkPortPrototype> OnPort = "On";
/// <summary>
/// The port that should be invoked when turning the generator off.
/// </summary>
[DataField]
public ProtoId<SinkPortPrototype> OffPort = "Off";
/// <summary>
/// The port that should be invoked when toggling the generator.
/// </summary>
[DataField]
public ProtoId<SinkPortPrototype> TogglePort = "Toggle";
}