Files
Delta-v/Content.Shared/_Goobstation/Factory/StartableMachineComponent.cs
T
AlgisAlphonse f7db03182a Port goobstation factorio (#4035)
* Initial port of goobstation factorio, missing disposals integration and faxing. Also ports impstations modification for robotic arms to have static power draw. Also adds automation slots to silos and advanced microwave.

* Ports goobstation factorio fax automation, adds to the guidebook entry info about gas canisters.

* Ported Goob Disposals. Removed part about taking
mats out of storage silo cuz it ain't implemented
yet. Seems to work.

* Adds constructor circuitboard to research cuz I
forgor
2025-07-27 13:31:36 +01:00

63 lines
2.0 KiB
C#

// SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
// SPDX-FileCopyrightText: 2025 coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
// SPDX-FileCopyrightText: 2025 deltanedas <39013340+deltanedas@users.noreply.github.com>
// SPDX-FileCopyrightText: 2025 deltanedas <@deltanedas:kde.org>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
using Content.Shared.DeviceLinking;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared._Goobstation.Factory;
/// <summary>
/// Machine that can be started with a signal.
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(StartableMachineSystem))]
public sealed partial class StartableMachineComponent : Component
{
/// <summary>
/// Port you invoke to start the machine and raise <see cref="MachineStartedEvent"/>.
/// </summary>
[DataField]
public ProtoId<SinkPortPrototype> StartPort = "Start";
/// <summary>
/// Controls <see cref="AutoStart"/>.
/// Pulses toggle instead of setting true/false.
/// </summary>
[DataField]
public ProtoId<SinkPortPrototype> AutoStartPort = "AutoStart";
/// <summary>
/// Whether starting will work when <c>TryAutoStart</c> is called.
/// </summary>
/// <remarks>
/// Signals aren't predicted yet so not networked.
/// </remarks>
[DataField(serverOnly: true)]
public bool AutoStart;
/// <summary>
/// Queues an auto start for the next tick.
/// </summary>
[DataField(serverOnly: true)]
public bool AutoStartQueued;
[DataField]
public ProtoId<SourcePortPrototype> StartedPort = "Started";
[DataField]
public ProtoId<SourcePortPrototype> CompletedPort = "Completed";
[DataField]
public ProtoId<SourcePortPrototype> FailedPort = "Failed";
}
/// <summary>
/// Raised on the server when the start port is invoked while powered.
/// </summary>
[ByRefEvent]
public readonly record struct MachineStartedEvent();