Bunch more resolves removed.

This commit is contained in:
Vera Aguilera Puerto
2021-12-08 17:17:12 +01:00
parent ba736f70df
commit 684cb76173
38 changed files with 267 additions and 208 deletions

View File

@@ -14,6 +14,8 @@ namespace Content.Server.Doors.Components
[RegisterComponent]
public class FirelockComponent : Component
{
[Dependency] private readonly IEntityManager _entMan = default!;
public override string Name => "Firelock";
[ComponentDependency]
@@ -31,7 +33,7 @@ namespace Content.Server.Doors.Components
if (DoorComponent != null && DoorComponent.State == SharedDoorComponent.DoorState.Open && DoorComponent.CanCloseGeneric())
{
DoorComponent.Close();
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out AirtightComponent? airtight))
if (_entMan.TryGetComponent(Owner, out AirtightComponent? airtight))
{
EntitySystem.Get<AirtightSystem>().SetAirblocked(airtight, true);
}
@@ -47,7 +49,7 @@ namespace Content.Server.Doors.Components
var minMoles = float.MaxValue;
var maxMoles = 0f;
foreach (var adjacent in atmosphereSystem.GetAdjacentTileMixtures(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).Coordinates))
foreach (var adjacent in atmosphereSystem.GetAdjacentTileMixtures(_entMan.GetComponent<TransformComponent>(Owner).Coordinates))
{
var moles = adjacent.TotalMoles;
if (moles < minMoles)
@@ -63,7 +65,7 @@ namespace Content.Server.Doors.Components
{
var atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
if (!atmosphereSystem.TryGetGridAndTile(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).Coordinates, out var tuple))
if (!atmosphereSystem.TryGetGridAndTile(_entMan.GetComponent<TransformComponent>(Owner).Coordinates, out var tuple))
return false;
if (atmosphereSystem.GetTileMixture(tuple.Value.Grid, tuple.Value.Tile) == null)
@@ -72,7 +74,7 @@ namespace Content.Server.Doors.Components
if (atmosphereSystem.IsHotspotActive(tuple.Value.Grid, tuple.Value.Tile))
return true;
foreach (var adjacent in atmosphereSystem.GetAdjacentTiles(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).Coordinates))
foreach (var adjacent in atmosphereSystem.GetAdjacentTiles(_entMan.GetComponent<TransformComponent>(Owner).Coordinates))
{
if (atmosphereSystem.IsHotspotActive(tuple.Value.Grid, adjacent))
return true;