Even more resolve removals.

This commit is contained in:
Vera Aguilera Puerto
2021-12-08 17:32:32 +01:00
parent 684cb76173
commit cdc8336695
61 changed files with 364 additions and 278 deletions

View File

@@ -18,6 +18,8 @@ namespace Content.Server.Power.Components
public abstract class BaseNetConnectorComponent<TNetType> : Component, IBaseNetConnectorComponent<TNetType>
{
[Dependency] private readonly IEntityManager _entMan = default!;
[ViewVariables(VVAccess.ReadWrite)]
public Voltage Voltage { get => _voltage; set => SetVoltage(value); }
[DataField("voltage")]
@@ -68,7 +70,7 @@ namespace Content.Server.Power.Components
private bool TryFindNet([NotNullWhen(true)] out TNetType? foundNet)
{
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<NodeContainerComponent?>(Owner, out var container))
if (_entMan.TryGetComponent<NodeContainerComponent?>(Owner, out var container))
{
var compatibleNet = container.Nodes.Values
.Where(node => (NodeId == null || NodeId == node.Name) && node.NodeGroupID == (NodeGroupID) Voltage)