Removed EntityManager member variable from Components and EntitySystems (#2502)

* Removed EntityManager member variable from Components and EntitySystems

* Removed EntityManager with minor corecctions

* Update PathfindingSystem.cs

* Update InteractionSystem.cs

* Update Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs

Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>

* Update Content.Client/GameObjects/Components/Suspicion/SuspicionRoleComponent.cs

Co-authored-by: Clyybber <darkmine956@gmail.com>

* Update Content.Client/GameObjects/Components/Suspicion/TraitorOverlay.cs

Co-authored-by: Clyybber <darkmine956@gmail.com>

* Update Content.Server/GameObjects/Components/Buckle/BuckleComponent.cs

Co-authored-by: Clyybber <darkmine956@gmail.com>

* Update Content.Server/GameObjects/Components/Buckle/BuckleComponent.cs

Co-authored-by: Clyybber <darkmine956@gmail.com>

* Update Content.Server/GameObjects/Components/PDA/PDAComponent.cs

Co-authored-by: Clyybber <darkmine956@gmail.com>

* Update Content.Server/GameObjects/Components/Singularity/SingularityComponent.cs

Co-authored-by: Clyybber <darkmine956@gmail.com>

* Update Content.Server/GameObjects/Components/Singularity/SingularityComponent.cs

Co-authored-by: Clyybber <darkmine956@gmail.com>

* Update Content.Server/GameObjects/EntitySystems/AI/Pathfinding/PathfindingSystem.cs

Co-authored-by: Clyybber <darkmine956@gmail.com>

* Update Content.Server/GameObjects/EntitySystems/Click/ExamineSystem.cs

Co-authored-by: Clyybber <darkmine956@gmail.com>

* Update Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs

Co-authored-by: Clyybber <darkmine956@gmail.com>

* Update Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs

Co-authored-by: Clyybber <darkmine956@gmail.com>

* Update Content.Server/GameObjects/Components/Stack/StackComponent.cs

Co-authored-by: Clyybber <darkmine956@gmail.com>

Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
Co-authored-by: Clyybber <darkmine956@gmail.com>
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
ColdAutumnRain
2020-11-18 15:45:53 +01:00
committed by GitHub
parent 87e74c4494
commit f5dc62b533
42 changed files with 66 additions and 118 deletions

View File

@@ -31,8 +31,6 @@ namespace Content.Server.GameObjects.Components.Atmos
[RegisterComponent]
public class FlammableComponent : SharedFlammableComponent, ICollideBehavior, IFireAct, IReagentReaction
{
[Dependency] private IEntityManager _entityManager = default!;
private bool _resisting = false;
private readonly List<EntityUid> _collided = new List<EntityUid>();
@@ -137,13 +135,13 @@ namespace Content.Server.GameObjects.Components.Atmos
foreach (var uid in _collided.ToArray())
{
if (!uid.IsValid() || !_entityManager.EntityExists(uid))
if (!uid.IsValid() || !Owner.EntityManager.EntityExists(uid))
{
_collided.Remove(uid);
continue;
}
var entity = _entityManager.GetEntity(uid);
var entity = Owner.EntityManager.GetEntity(uid);
var physics = Owner.GetComponent<IPhysicsComponent>();
var otherPhysics = entity.GetComponent<IPhysicsComponent>();

View File

@@ -26,8 +26,6 @@ namespace Content.Server.GameObjects.Components.Atmos
[RegisterComponent]
public class GasAnalyzerComponent : SharedGasAnalyzerComponent, IAfterInteract, IDropped, IUse
{
[Dependency] private readonly IEntityManager _entityManager = default!;
private GasAnalyzerDanger _pressureDanger;
private float _timeSinceSync;
private const float TimeBetweenSyncs = 2f;
@@ -183,14 +181,14 @@ namespace Content.Server.GameObjects.Components.Atmos
if (!_checkPlayer && _position.HasValue)
{
// Check if position is out of range => don't update
if (!_position.Value.InRange(_entityManager, pos, SharedInteractionSystem.InteractionRange))
if (!_position.Value.InRange(Owner.EntityManager, pos, SharedInteractionSystem.InteractionRange))
return;
pos = _position.Value;
}
var atmosSystem = EntitySystem.Get<AtmosphereSystem>();
var gam = atmosSystem.GetGridAtmosphere(pos.GetGridId(_entityManager));
var gam = atmosSystem.GetGridAtmosphere(pos.GetGridId(Owner.EntityManager));
var tile = gam?.GetTile(pos).Air;
if (tile == null)
{

View File

@@ -18,7 +18,6 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping.Scrubbers
/// </summary>
public abstract class BaseSiphonComponent : PipeNetDeviceComponent
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[ViewVariables]
private PipeNode _scrubberOutlet;
@@ -65,7 +64,7 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping.Scrubbers
if (!SiphonEnabled)
return;
var tileAtmos = Owner.Transform.Coordinates.GetTileAtmosphere(_entityManager);
var tileAtmos = Owner.Transform.Coordinates.GetTileAtmosphere(Owner.EntityManager);
if (tileAtmos == null)
return;
ScrubGas(tileAtmos.Air, _scrubberOutlet.Air);

View File

@@ -18,7 +18,6 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping.Vents
/// </summary>
public abstract class BaseVentComponent : PipeNetDeviceComponent
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[ViewVariables]
private PipeNode _ventInlet;
@@ -65,7 +64,7 @@ namespace Content.Server.GameObjects.Components.Atmos.Piping.Vents
if (!VentEnabled)
return;
var tileAtmos = Owner.Transform.Coordinates.GetTileAtmosphere(_entityManager);
var tileAtmos = Owner.Transform.Coordinates.GetTileAtmosphere(Owner.EntityManager);
if (tileAtmos == null)
return;
VentGas(_ventInlet.Air, tileAtmos.Air);