Replace resolve dependency with attribute in components (#1995)

* Replace resolve dependency with attribute in components

* Add changes that went missing in translation
This commit is contained in:
DrSmugleaf
2020-09-02 01:30:03 +02:00
committed by GitHub
parent 4044602187
commit de9dfefd61
23 changed files with 85 additions and 66 deletions

View File

@@ -40,6 +40,8 @@ namespace Content.Server.GameObjects.Components.Chemistry
[ComponentReference(typeof(IInteractUsing))]
public class ReagentDispenserComponent : SharedReagentDispenserComponent, IActivate, IInteractUsing, ISolutionChange
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[ViewVariables] private ContainerSlot _beakerContainer = default!;
[ViewVariables] private string _packPrototypeId = "";
@@ -97,8 +99,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
{
if (string.IsNullOrEmpty(_packPrototypeId)) return;
var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
if (!prototypeManager.TryIndex(_packPrototypeId, out ReagentDispenserInventoryPrototype packPrototype))
if (!_prototypeManager.TryIndex(_packPrototypeId, out ReagentDispenserInventoryPrototype packPrototype))
{
return;
}