Portable Generator Rework (#19302)

This commit is contained in:
Pieter-Jan Briers
2023-08-25 20:40:42 +02:00
committed by GitHub
parent 50828363fe
commit bf16698efa
73 changed files with 1933 additions and 473 deletions

View File

@@ -1,6 +1,6 @@
using Content.Server.NodeContainer;
using Content.Server.NodeContainer.EntitySystems;
using Content.Server.NodeContainer.Nodes;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
namespace Content.Server.Power.Nodes
@@ -12,6 +12,24 @@ namespace Content.Server.Power.Nodes
[Virtual]
public partial class CableDeviceNode : Node
{
/// <summary>
/// If disabled, this cable device will never connect.
/// </summary>
/// <remarks>
/// If you change this,
/// you must manually call <see cref="NodeGroupSystem.QueueReflood"/> to update the node connections.
/// </remarks>
[DataField("enabled")]
public bool Enabled { get; set; } = true;
public override bool Connectable(IEntityManager entMan, TransformComponent? xform = null)
{
if (!Enabled)
return false;
return base.Connectable(entMan, xform);
}
public override IEnumerable<Node> GetReachableNodes(TransformComponent xform,
EntityQuery<NodeContainerComponent> nodeQuery,
EntityQuery<TransformComponent> xformQuery,