ECS Atmos Part 5: Moves all logic from GridAtmosphereComponent to AtmosphereSystem. (#4331)

This commit is contained in:
Vera Aguilera Puerto
2021-07-23 11:09:01 +02:00
committed by GitHub
parent 354ef6daf3
commit 4112847142
23 changed files with 1242 additions and 1355 deletions

View File

@@ -8,7 +8,9 @@ using Content.Server.Interfaces;
using Content.Server.NodeContainer.Nodes;
using Content.Shared.Atmos;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
namespace Content.Server.NodeContainer.NodeGroups
@@ -30,16 +32,14 @@ namespace Content.Server.NodeContainer.NodeGroups
[ViewVariables] private AtmosphereSystem? _atmosphereSystem;
[ViewVariables]
private IGridAtmosphereComponent? GridAtmos =>
_atmosphereSystem?.GetGridAtmosphere(GridId);
public GridId Grid => GridId;
public override void Initialize(Node sourceNode)
{
base.Initialize(sourceNode);
_atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
GridAtmos?.AddPipeNet(this);
_atmosphereSystem.AddPipeNet(this);
}
public void Update()
@@ -94,7 +94,8 @@ namespace Content.Server.NodeContainer.NodeGroups
private void RemoveFromGridAtmos()
{
GridAtmos?.RemovePipeNet(this);
DebugTools.AssertNotNull(_atmosphereSystem);
_atmosphereSystem?.RemovePipeNet(this);
}
}
}