Little NodeContainer ECS (#17702)

This commit is contained in:
faint
2023-06-28 14:28:38 +03:00
committed by GitHub
parent c25f3f08ed
commit 2f85b5ea3c
27 changed files with 143 additions and 88 deletions

View File

@@ -2,6 +2,7 @@ using Content.Server.Atmos.EntitySystems;
using Content.Server.Atmos.Piping.Binary.Components;
using Content.Server.Atmos.Piping.Components;
using Content.Server.NodeContainer;
using Content.Server.NodeContainer.EntitySystems;
using Content.Server.NodeContainer.Nodes;
using Content.Shared.Atmos;
using Content.Shared.Examine;
@@ -13,6 +14,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
public sealed class GasPassiveGateSystem : EntitySystem
{
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly NodeContainerSystem _nodeContainer = default!;
public override void Initialize()
{
@@ -27,8 +29,8 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
if (!EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer))
return;
if (!nodeContainer.TryGetNode(gate.InletName, out PipeNode? inlet)
|| !nodeContainer.TryGetNode(gate.OutletName, out PipeNode? outlet))
if (!_nodeContainer.TryGetNode(nodeContainer, gate.InletName, out PipeNode? inlet)
|| !_nodeContainer.TryGetNode(nodeContainer, gate.OutletName, out PipeNode? outlet))
return;
var n1 = inlet.Air.TotalMoles;