Remove IoC resolves in BaseNetConnectorNodeGroup and friends (#20333)

This commit is contained in:
Leon Friedrich
2023-09-20 00:44:49 +12:00
committed by GitHub
parent 39af74e0a3
commit 86fa8ae180
6 changed files with 53 additions and 50 deletions

View File

@@ -1,4 +1,6 @@
using Content.Server.Power.Components;
using Content.Server.NodeContainer.Nodes;
using Content.Server.Power.Components;
using Content.Server.Power.EntitySystems;
using Content.Server.Power.Pow3r;
using Robust.Shared.Utility;
@@ -9,10 +11,17 @@ public abstract class BasePowerNet<TNetType> : BaseNetConnectorNodeGroup<TNetTyp
{
[ViewVariables] public readonly List<PowerConsumerComponent> Consumers = new();
[ViewVariables] public readonly List<PowerSupplierComponent> Suppliers = new();
public PowerNetSystem PowerNetSystem = default!;
[ViewVariables]
public PowerState.Network NetworkNode { get; } = new();
public override void Initialize(Node sourceNode, IEntityManager entMan)
{
base.Initialize(sourceNode, entMan);
PowerNetSystem = entMan.EntitySysManager.GetEntitySystem<PowerNetSystem>();
}
public void AddConsumer(PowerConsumerComponent consumer)
{
DebugTools.Assert(consumer.NetworkLoad.LinkedNetwork == default);