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

@@ -8,6 +8,8 @@ namespace Content.Server.Recycling.Components
[RegisterComponent]
public class RecyclableComponent : Component
{
[Dependency] private readonly IEntityManager _entMan = default!;
public override string Name => "Recyclable";
/// <summary>
@@ -33,12 +35,12 @@ namespace Content.Server.Recycling.Components
{
for (var i = 0; i < Math.Max(_amount * efficiency, 1); i++)
{
IoCManager.Resolve<IEntityManager>().SpawnEntity(_prototype, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner).Coordinates);
_entMan.SpawnEntity(_prototype, _entMan.GetComponent<TransformComponent>(Owner).Coordinates);
}
}
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(Owner);
_entMan.QueueDeleteEntity(Owner);
}
}
}

View File

@@ -21,6 +21,8 @@ namespace Content.Server.Recycling.Components
[Friend(typeof(RecyclerSystem))]
public class RecyclerComponent : Component, ISuicideAct
{
[Dependency] private readonly IEntityManager _entMan = default!;
public override string Name => "Recycler";
/// <summary>
@@ -39,7 +41,7 @@ namespace Content.Server.Recycling.Components
private void Clean()
{
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out AppearanceComponent? appearance))
if (_entMan.TryGetComponent(Owner, out AppearanceComponent? appearance))
{
appearance.SetData(RecyclerVisuals.Bloody, false);
}
@@ -47,7 +49,7 @@ namespace Content.Server.Recycling.Components
SuicideKind ISuicideAct.Suicide(EntityUid victim, IChatManager chat)
{
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(victim, out ActorComponent? actor) && actor.PlayerSession.ContentData()?.Mind is {} mind)
if (_entMan.TryGetComponent(victim, out ActorComponent? actor) && actor.PlayerSession.ContentData()?.Mind is {} mind)
{
EntitySystem.Get<GameTicker>().OnGhostAttempt(mind, false);
mind.OwnedEntity?.PopupMessage(Loc.GetString("recycler-component-suicide-message"));
@@ -55,7 +57,7 @@ namespace Content.Server.Recycling.Components
victim.PopupMessageOtherClients(Loc.GetString("recycler-component-suicide-message-others", ("victim",victim)));
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SharedBodyComponent?>(victim, out var body))
if (_entMan.TryGetComponent<SharedBodyComponent?>(victim, out var body))
{
body.Gib(true);
}