Split entity lookups from entity manager (#3747)

* Split entity lookups from entity manager

* IoC instead

* IoC refactor

* Fix bad resolve

* Remove EntityManager EntityLookup

* Update submodule

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2021-04-06 13:31:07 +10:00
committed by GitHub
parent 677706b117
commit 67f9e9cb5e
24 changed files with 50 additions and 44 deletions

View File

@@ -95,7 +95,7 @@ namespace Content.Server.Commands.Chat
}
}
// Get all entities in range of the suicider
var entities = owner.EntityManager.GetEntitiesInRange(owner, 1, true).ToArray();
var entities = IoCManager.Resolve<IEntityLookup>().GetEntitiesInRange(owner, 1, true).ToArray();
if (entities.Length > 0)
{

View File

@@ -6,6 +6,7 @@ using Content.Shared.Administration;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.Commands.Interactable
@@ -43,8 +44,7 @@ namespace Content.Server.Commands.Interactable
return;
}
var serverEntityManager = IoCManager.Resolve<IServerEntityManager>();
var entities = serverEntityManager.GetEntitiesInRange(player.AttachedEntity, radius).ToList();
var entities = IoCManager.Resolve<IEntityLookup>().GetEntitiesInRange(player.AttachedEntity, radius).ToList();
foreach (var entity in entities)
{

View File

@@ -6,6 +6,7 @@ using Content.Shared.Administration;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.Commands.Interactable
@@ -43,8 +44,7 @@ namespace Content.Server.Commands.Interactable
return;
}
var serverEntityManager = IoCManager.Resolve<IServerEntityManager>();
var entities = serverEntityManager.GetEntitiesInRange(player.AttachedEntity, radius).ToList();
var entities = IoCManager.Resolve<IEntityLookup>().GetEntitiesInRange(player.AttachedEntity, radius).ToList();
foreach (var entity in entities)
{