Pressure & volume pumps can be toggled on/off now. (#3046)

This tidbit might or might not be suitable for a separate component.
Tell me in PR comments I guess.
This commit is contained in:
20kdc
2021-02-04 09:47:04 +00:00
committed by GitHub
parent 29918b2810
commit b9aa789bc4
3 changed files with 11 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ using Content.Server.Atmos;
using Content.Server.GameObjects.Components.NodeContainer;
using Content.Server.GameObjects.Components.NodeContainer.Nodes;
using Content.Shared.GameObjects.Components.Atmos;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
@@ -16,7 +17,7 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping.Pumps
/// <summary>
/// Transfer gas from one <see cref="PipeNode"/> to another.
/// </summary>
public abstract class BasePumpComponent : Component
public abstract class BasePumpComponent : Component, IActivate
{
/// <summary>
/// If the pump is currently pumping.
@@ -100,6 +101,11 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping.Pumps
_appearance?.SetData(PumpVisuals.VisualState, new PumpVisualState(_initialInletDirection, _initialOutletDirection, PumpEnabled));
}
public void Activate(ActivateEventArgs eventArgs)
{
PumpEnabled = !PumpEnabled;
}
private void SetPipes()
{
_inletPipe = null;