diff --git a/Content.Client/Doors/AirlockVisualizer.cs b/Content.Client/Doors/AirlockVisualizer.cs index 4802a3f3d0..9fc2185fd0 100644 --- a/Content.Client/Doors/AirlockVisualizer.cs +++ b/Content.Client/Doors/AirlockVisualizer.cs @@ -7,6 +7,7 @@ using JetBrains.Annotations; using Robust.Client.Animations; using Robust.Client.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; @@ -113,7 +114,7 @@ namespace Content.Client.Doors { if (!entity.HasComponent()) { - entity.AddComponent(); + IoCManager.Resolve().AddComponent(entity); } } diff --git a/Content.Client/Entry/EntryPoint.cs b/Content.Client/Entry/EntryPoint.cs index dbf99df92c..c74262e2f0 100644 --- a/Content.Client/Entry/EntryPoint.cs +++ b/Content.Client/Entry/EntryPoint.cs @@ -143,7 +143,7 @@ namespace Content.Client.Entry /// public static void AttachPlayerToEntity(EntityAttachedEventArgs eventArgs) { - eventArgs.NewEntity.AddComponent(); + IoCManager.Resolve().AddComponent(eventArgs.NewEntity); } /// diff --git a/Content.Client/Lathe/Visualizers/AutolatheVisualizer.cs b/Content.Client/Lathe/Visualizers/AutolatheVisualizer.cs index a9ba95597a..b6a0f7e1de 100644 --- a/Content.Client/Lathe/Visualizers/AutolatheVisualizer.cs +++ b/Content.Client/Lathe/Visualizers/AutolatheVisualizer.cs @@ -5,6 +5,7 @@ using JetBrains.Annotations; using Robust.Client.Animations; using Robust.Client.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; namespace Content.Client.Lathe.Visualizers { @@ -51,7 +52,7 @@ namespace Content.Client.Lathe.Visualizers { if (!entity.HasComponent()) { - entity.AddComponent(); + IoCManager.Resolve().AddComponent(entity); } } diff --git a/Content.Client/Lathe/Visualizers/ProtolatheVisualizer.cs b/Content.Client/Lathe/Visualizers/ProtolatheVisualizer.cs index ef75bf1683..dc509b8d9c 100644 --- a/Content.Client/Lathe/Visualizers/ProtolatheVisualizer.cs +++ b/Content.Client/Lathe/Visualizers/ProtolatheVisualizer.cs @@ -5,6 +5,7 @@ using JetBrains.Annotations; using Robust.Client.Animations; using Robust.Client.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; namespace Content.Client.Lathe.Visualizers { @@ -51,7 +52,7 @@ namespace Content.Client.Lathe.Visualizers { if (!entity.HasComponent()) { - entity.AddComponent(); + IoCManager.Resolve().AddComponent(entity); } } diff --git a/Content.Client/Singularity/Visualizers/RadiationCollectorVisualizer.cs b/Content.Client/Singularity/Visualizers/RadiationCollectorVisualizer.cs index 459ab2e7a7..31037edec5 100644 --- a/Content.Client/Singularity/Visualizers/RadiationCollectorVisualizer.cs +++ b/Content.Client/Singularity/Visualizers/RadiationCollectorVisualizer.cs @@ -4,6 +4,7 @@ using JetBrains.Annotations; using Robust.Client.Animations; using Robust.Client.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Serialization; namespace Content.Client.Singularity.Visualizers @@ -47,7 +48,7 @@ namespace Content.Client.Singularity.Visualizers { if (!entity.HasComponent()) { - entity.AddComponent(); + IoCManager.Resolve().AddComponent(entity); } } diff --git a/Content.Client/Trigger/TimerTriggerVisualizer.cs b/Content.Client/Trigger/TimerTriggerVisualizer.cs index 24051d99dc..1d27d5b50f 100644 --- a/Content.Client/Trigger/TimerTriggerVisualizer.cs +++ b/Content.Client/Trigger/TimerTriggerVisualizer.cs @@ -5,6 +5,7 @@ using JetBrains.Annotations; using Robust.Client.Animations; using Robust.Client.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; @@ -39,7 +40,7 @@ namespace Content.Client.Trigger { if (!entity.HasComponent()) { - entity.AddComponent(); + IoCManager.Resolve().AddComponent(entity); } } diff --git a/Content.Client/VendingMachines/UI/VendingMachineVisualizer.cs b/Content.Client/VendingMachines/UI/VendingMachineVisualizer.cs index 54c5906c86..9cef8db438 100644 --- a/Content.Client/VendingMachines/UI/VendingMachineVisualizer.cs +++ b/Content.Client/VendingMachines/UI/VendingMachineVisualizer.cs @@ -4,6 +4,7 @@ using JetBrains.Annotations; using Robust.Client.Animations; using Robust.Client.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; using static Content.Shared.VendingMachines.SharedVendingMachineComponent; @@ -122,7 +123,7 @@ namespace Content.Client.VendingMachines.UI if (!entity.HasComponent()) { - entity.AddComponent(); + IoCManager.Resolve().AddComponent(entity); } } diff --git a/Content.IntegrationTests/Tests/DeleteInventoryTest.cs b/Content.IntegrationTests/Tests/DeleteInventoryTest.cs index c29d4bebbf..62e65fe009 100644 --- a/Content.IntegrationTests/Tests/DeleteInventoryTest.cs +++ b/Content.IntegrationTests/Tests/DeleteInventoryTest.cs @@ -28,10 +28,10 @@ namespace Content.IntegrationTests.Tests var entMgr = IoCManager.Resolve(); var container = entMgr.SpawnEntity(null, MapCoordinates.Nullspace); - var inv = container.AddComponent(); + var inv = (InventoryComponent) IoCManager.Resolve().AddComponent(container); var child = entMgr.SpawnEntity(null, MapCoordinates.Nullspace); - var item = child.AddComponent(); + var item = (ClothingComponent) IoCManager.Resolve().AddComponent(child); item.SlotFlags = SlotFlags.HEAD; // Equip item. diff --git a/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs b/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs index 58a0bd7a5e..4aa754a755 100644 --- a/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs +++ b/Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs @@ -92,7 +92,7 @@ namespace Content.IntegrationTests.Tests.Networking var map = sMapManager.CreateMap(); var player = sPlayerManager.ServerSessions.Single(); serverEnt = sEntityManager.SpawnEntity(null, new MapCoordinates((0, 0), map)); - serverComponent = serverEnt.AddComponent(); + serverComponent = IoCManager.Resolve().AddComponent(serverEnt); // Make client "join game" so they receive game state updates. player.JoinGame(); diff --git a/Content.Server/AI/Commands/AddAiCommand.cs b/Content.Server/AI/Commands/AddAiCommand.cs index 24d4fc38fe..39aa4ae546 100644 --- a/Content.Server/AI/Commands/AddAiCommand.cs +++ b/Content.Server/AI/Commands/AddAiCommand.cs @@ -47,7 +47,7 @@ namespace Content.Server.AI.Commands ent.RemoveComponent(); } - var comp = ent.AddComponent(); + var comp = IoCManager.Resolve().AddComponent(ent); var behaviorManager = IoCManager.Resolve(); for (var i = 1; i < args.Length; i++) diff --git a/Content.Server/Atmos/Commands/AddAtmosCommand.cs b/Content.Server/Atmos/Commands/AddAtmosCommand.cs index 69c85997f5..6b6a467009 100644 --- a/Content.Server/Atmos/Commands/AddAtmosCommand.cs +++ b/Content.Server/Atmos/Commands/AddAtmosCommand.cs @@ -53,7 +53,7 @@ namespace Content.Server.Atmos.Commands return; } - grid.AddComponent(); + IoCManager.Resolve().AddComponent(grid); shell.WriteLine($"Added atmosphere to grid {id}."); } diff --git a/Content.Server/Atmos/Commands/AddUnsimulatedAtmosCommand.cs b/Content.Server/Atmos/Commands/AddUnsimulatedAtmosCommand.cs index 5fb659cc59..e68dacd958 100644 --- a/Content.Server/Atmos/Commands/AddUnsimulatedAtmosCommand.cs +++ b/Content.Server/Atmos/Commands/AddUnsimulatedAtmosCommand.cs @@ -53,7 +53,7 @@ namespace Content.Server.Atmos.Commands return; } - grid.AddComponent(); + IoCManager.Resolve().AddComponent(grid); shell.WriteLine($"Added unsimulated atmosphere to grid {id}."); } diff --git a/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs b/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs index fdb64e5f33..149da7042d 100644 --- a/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs +++ b/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs @@ -50,7 +50,7 @@ namespace Content.Server.Chemistry.Components return; Amount = amount; - var inception = Owner.AddComponent(); + var inception = IoCManager.Resolve().AddComponent(Owner); inception.Add(this); inception.Setup(amount, duration, spreadDelay, removeDelay); diff --git a/Content.Server/Cloning/Components/CloningPodComponent.cs b/Content.Server/Cloning/Components/CloningPodComponent.cs index c1ed74966f..aaeea3948e 100644 --- a/Content.Server/Cloning/Components/CloningPodComponent.cs +++ b/Content.Server/Cloning/Components/CloningPodComponent.cs @@ -141,7 +141,7 @@ namespace Content.Server.Cloning.Components EntitySystem.Get().UpdateFromProfile(mob.Uid, dna.Profile); mob.Name = dna.Profile.Name; - var cloneMindReturn = mob.AddComponent(); + var cloneMindReturn = IoCManager.Resolve().AddComponent(mob); cloneMindReturn.Mind = mind; cloneMindReturn.Parent = Owner.Uid; diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs index f2e4ac19e3..1807ce3969 100644 --- a/Content.Server/GameTicking/GameTicker.Spawning.cs +++ b/Content.Server/GameTicking/GameTicker.Spawning.cs @@ -123,7 +123,7 @@ namespace Content.Server.GameTicking if (player.UserId == new Guid("{e887eb93-f503-4b65-95b6-2f282c014192}")) { - mob.AddComponent(); + IoCManager.Resolve().AddComponent(mob); } AddManifestEntry(character.Name, jobId); diff --git a/Content.Server/GameTicking/Presets/PresetTraitorDeathMatch.cs b/Content.Server/GameTicking/Presets/PresetTraitorDeathMatch.cs index 14a784ab6a..ed337d1088 100644 --- a/Content.Server/GameTicking/Presets/PresetTraitorDeathMatch.cs +++ b/Content.Server/GameTicking/Presets/PresetTraitorDeathMatch.cs @@ -117,7 +117,7 @@ namespace Content.Server.GameTicking.Presets var pda = newPDA.GetComponent(); _entityManager.EntitySysManager.GetEntitySystem() .SetOwner(pda, mind.OwnedEntity.Name); - newPDA.AddComponent().UserId = mind.UserId; + IoCManager.Resolve().AddComponent(newPDA).UserId = mind.UserId; } // Finally, it would be preferrable if they spawned as far away from other players as reasonably possible. diff --git a/Content.Server/Mind/Mind.cs b/Content.Server/Mind/Mind.cs index bd16455cdd..43bb641a8d 100644 --- a/Content.Server/Mind/Mind.cs +++ b/Content.Server/Mind/Mind.cs @@ -357,7 +357,7 @@ namespace Content.Server.Mind Session?.AttachToEntity(entity); VisitingEntity = entity; - var comp = entity.AddComponent(); + var comp = IoCManager.Resolve().AddComponent(entity); comp.Mind = this; Logger.Info($"Session {Session?.Name} visiting entity {entity}."); diff --git a/Content.Server/Pointing/Components/PointingArrowComponent.cs b/Content.Server/Pointing/Components/PointingArrowComponent.cs index 832a23bb3b..e72a7142db 100644 --- a/Content.Server/Pointing/Components/PointingArrowComponent.cs +++ b/Content.Server/Pointing/Components/PointingArrowComponent.cs @@ -1,6 +1,7 @@ using Content.Shared.Pointing.Components; using Robust.Server.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; using DrawDepth = Content.Shared.DrawDepth.DrawDepth; @@ -76,7 +77,7 @@ namespace Content.Server.Pointing.Components if (_rogue) { Owner.RemoveComponent(); - Owner.AddComponent(); + IoCManager.Resolve().AddComponent(Owner); return; }