]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Clean up all missing `EntitySystem` proxy method uses (#38353)
authorTayrtahn <tayrtahn@gmail.com>
Thu, 26 Jun 2025 23:50:49 +0000 (19:50 -0400)
committerGitHub <noreply@github.com>
Thu, 26 Jun 2025 23:50:49 +0000 (16:50 -0700)
185 files changed:
Content.Client/Actions/ActionsSystem.cs
Content.Client/Audio/AmbientSoundSystem.cs
Content.Client/Construction/ConstructionSystem.cs
Content.Client/Examine/ExamineSystem.cs
Content.Client/Explosion/TriggerSystem.Proximity.cs
Content.Client/Hands/Systems/HandsSystem.cs
Content.Client/Humanoid/HumanoidAppearanceSystem.cs
Content.Client/Inventory/ClientInventorySystem.cs
Content.Client/Light/EntitySystems/LightBehaviorSystem.cs
Content.Client/Markers/MarkerSystem.cs
Content.Client/Orbit/OrbitVisualsSystem.cs
Content.Client/Sandbox/SandboxSystem.cs
Content.Client/Tabletop/TabletopSystem.cs
Content.Client/Verbs/VerbSystem.cs
Content.Client/Weapons/Ranged/Systems/GunSystem.cs
Content.IntegrationTests/Tests/Disposal/DisposalUnitTest.cs
Content.IntegrationTests/Tests/Networking/SimplePredictReconcileTest.cs
Content.Server/Access/Systems/AccessOverriderSystem.cs
Content.Server/Access/Systems/IdCardConsoleSystem.cs
Content.Server/Access/Systems/IdCardSystem.cs
Content.Server/Administration/Systems/AdminSystem.cs
Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs
Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs
Content.Server/Administration/Systems/AdminVerbSystem.cs
Content.Server/Ame/EntitySystems/AmeControllerSystem.cs
Content.Server/Arcade/BlockGame/BlockGameArcadeSystem.cs
Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs
Content.Server/Atmos/Consoles/AtmosMonitoringConsoleSystem.cs
Content.Server/Atmos/EntitySystems/AirtightSystem.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs
Content.Server/Atmos/EntitySystems/FlammableSystem.cs
Content.Server/Atmos/Monitor/Systems/AtmosAlarmableSystem.cs
Content.Server/Atmos/Piping/Binary/EntitySystems/GasRecyclerSystem.cs
Content.Server/Atmos/Piping/EntitySystems/AtmosPipeColorSystem.cs
Content.Server/Atmos/Piping/EntitySystems/AtmosUnsafeUnanchorSystem.cs
Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs
Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasPortableSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs
Content.Server/Bible/BibleSystem.cs
Content.Server/Cargo/Systems/CargoSystem.Orders.cs
Content.Server/CartridgeLoader/Cartridges/NanoTaskCartridgeSystem.cs
Content.Server/Chat/SuicideSystem.cs
Content.Server/Chat/Systems/ChatSystem.cs
Content.Server/Chemistry/EntitySystems/DeleteOnSolutionEmptySystem.cs
Content.Server/Chemistry/EntitySystems/InjectorSystem.cs
Content.Server/Chemistry/EntitySystems/VaporSystem.cs
Content.Server/Cloning/CloningPodSystem.cs
Content.Server/Cloning/CloningSystem.cs
Content.Server/Codewords/CodewordSystem.cs
Content.Server/Construction/ConstructionSystem.Computer.cs
Content.Server/Construction/ConstructionSystem.Graph.cs
Content.Server/Construction/ConstructionSystem.Initial.cs
Content.Server/Construction/ConstructionSystem.cs
Content.Server/Crayon/CrayonSystem.cs
Content.Server/Damage/Systems/DamageOnToolInteractSystem.cs
Content.Server/DeviceNetwork/Systems/ApcNetworkSystem.cs
Content.Server/DeviceNetwork/Systems/Devices/ApcNetSwitchSystem.cs
Content.Server/Disposal/Tube/DisposalTubeSystem.cs
Content.Server/Disposal/Unit/DisposableSystem.cs
Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs
Content.Server/EntityEffects/EntityEffectSystem.cs
Content.Server/Examine/ExamineSystem.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.Airtight.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
Content.Server/Explosion/EntitySystems/TriggerSystem.Proximity.cs
Content.Server/Explosion/EntitySystems/TriggerSystem.cs
Content.Server/Explosion/EntitySystems/TwoStageTriggerSystem.cs
Content.Server/Fax/FaxSystem.cs
Content.Server/Fluids/EntitySystems/DrainSystem.cs
Content.Server/Fluids/EntitySystems/PuddleDebugDebugOverlaySystem.cs
Content.Server/Fluids/EntitySystems/PuddleSystem.cs
Content.Server/Forensics/Systems/ForensicScannerSystem.cs
Content.Server/GameTicking/GameTicker.Spawning.cs
Content.Server/Ghost/GhostSystem.cs
Content.Server/Ghost/Roles/GhostRoleSystem.cs
Content.Server/Hands/Systems/HandsSystem.cs
Content.Server/Holosign/HolosignSystem.cs
Content.Server/Humanoid/Systems/RandomHumanoidSystem.cs
Content.Server/ImmovableRod/ImmovableRodSystem.cs
Content.Server/Instruments/InstrumentSystem.cs
Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs
Content.Server/Kitchen/EntitySystems/SharpSystem.cs
Content.Server/Light/EntitySystems/ExpendableLightSystem.cs
Content.Server/Light/EntitySystems/PoweredLightSystem.cs
Content.Server/MassMedia/Systems/NewsSystem.cs
Content.Server/Mech/Systems/MechAssemblySystem.cs
Content.Server/Medical/HealingSystem.cs
Content.Server/Medical/SuitSensors/SuitSensorSystem.cs
Content.Server/Morgue/CrematoriumSystem.cs
Content.Server/NPC/Systems/NPCSteeringSystem.cs
Content.Server/Nutrition/EntitySystems/CreamPieSystem.cs
Content.Server/Nutrition/EntitySystems/SmokingSystem.Cigar.cs
Content.Server/Nutrition/EntitySystems/SmokingSystem.SmokingPipe.cs
Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs
Content.Server/Nutrition/EntitySystems/TrashOnSolutionEmptySystem.cs
Content.Server/Payload/EntitySystems/PayloadSystem.cs
Content.Server/Physics/Controllers/RandomWalkController.cs
Content.Server/Pinpointer/PinpointerSystem.cs
Content.Server/Pointing/EntitySystems/PointingSystem.cs
Content.Server/Pointing/EntitySystems/RoguePointingSystem.cs
Content.Server/Power/EntitySystems/CableSystem.Placer.cs
Content.Server/Power/EntitySystems/ExtensionCableSystem.cs
Content.Server/Power/EntitySystems/PowerMonitoringConsoleSystem.cs
Content.Server/PowerSink/PowerSinkSystem.cs
Content.Server/Prayer/PrayerSystem.cs
Content.Server/Procedural/DungeonSystem.Commands.cs
Content.Server/Projectiles/ProjectileSystem.cs
Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs
Content.Server/Repairable/RepairableSystem.cs
Content.Server/Research/Disk/ResearchDiskSystem.cs
Content.Server/Rotatable/RotatableSystem.cs
Content.Server/Shuttles/Systems/DockingSystem.cs
Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs
Content.Server/Shuttles/Systems/ShuttleSystem.cs
Content.Server/Shuttles/Systems/ThrusterSystem.cs
Content.Server/Silicons/StationAi/StationAiSystem.cs
Content.Server/Singularity/EntitySystems/EventHorizonSystem.cs
Content.Server/Singularity/EntitySystems/RadiationCollectorSystem.cs
Content.Server/Singularity/EntitySystems/SingularityGeneratorSystem.cs
Content.Server/Singularity/EntitySystems/SingularitySystem.cs
Content.Server/Solar/EntitySystems/PowerSolarSystem.cs
Content.Server/Spawners/EntitySystems/ConditionalSpawnerSystem.cs
Content.Server/Species/Systems/NymphSystem.cs
Content.Server/Speech/EntitySystems/AddAccentClothingSystem.cs
Content.Server/Spreader/KudzuSystem.cs
Content.Server/Station/Systems/StationSpawningSystem.cs
Content.Server/StationEvents/Events/VentClogRule.cs
Content.Server/Storage/EntitySystems/BluespaceLockerSystem.cs
Content.Server/Storage/EntitySystems/ItemCounterSystem.cs
Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs
Content.Server/Store/Systems/StoreSystem.Ui.cs
Content.Server/Stunnable/Systems/StunOnCollideSystem.cs
Content.Server/SurveillanceCamera/Systems/SurveillanceCameraMonitorSystem.cs
Content.Server/Tabletop/TabletopSystem.Map.cs
Content.Server/Tabletop/TabletopSystem.Session.cs
Content.Server/Tabletop/TabletopSystem.cs
Content.Server/Telephone/TelephoneSystem.cs
Content.Server/Traits/TraitSystem.cs
Content.Server/Verbs/VerbSystem.cs
Content.Server/Wires/WiresSystem.cs
Content.Shared/Access/Systems/IdExaminableSystem.cs
Content.Shared/Actions/ActionUpgradeSystem.cs
Content.Shared/Alert/AlertsSystem.cs
Content.Shared/Animals/UdderSystem.cs
Content.Shared/Animals/WoolySystem.cs
Content.Shared/Bed/Cryostorage/SharedCryostorageSystem.cs
Content.Shared/Chemistry/EntitySystems/HypospraySystem.cs
Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.cs
Content.Shared/Chemistry/MetabolismMovespeedModifierSystem.cs
Content.Shared/Construction/EntitySystems/AnchorableSystem.cs
Content.Shared/Containers/ContainerFillSystem.cs
Content.Shared/Containers/ItemSlot/ItemSlotsSystem.cs
Content.Shared/Cuffs/SharedCuffableSystem.cs
Content.Shared/Damage/Systems/DamageOnHighSpeedImpactSystem.cs
Content.Shared/Damage/Systems/SlowOnDamageSystem.cs
Content.Shared/Disposal/Mailing/SharedMailingUnitSystem.cs
Content.Shared/Examine/ExamineSystemShared.cs
Content.Shared/Gravity/SharedGravitySystem.cs
Content.Shared/Implants/SharedImplanterSystem.cs
Content.Shared/Inventory/InventorySystem.Helpers.cs
Content.Shared/Jittering/SharedJitteringSystem.cs
Content.Shared/Magic/SharedMagicSystem.cs
Content.Shared/Movement/Pulling/Systems/PullingSystem.cs
Content.Shared/Movement/Systems/FrictionContactsSystem.cs
Content.Shared/Movement/Systems/SpeedModifierContactsSystem.cs
Content.Shared/Nutrition/EntitySystems/SharedCreamPieSystem.cs
Content.Shared/Nutrition/EntitySystems/UtensilSystem.cs
Content.Shared/Paper/PaperSystem.cs
Content.Shared/RCD/Systems/RCDSystem.cs
Content.Shared/Singularity/EntitySystems/SharedEventHorizonSystem.cs
Content.Shared/Station/SharedStationSpawningSystem.cs
Content.Shared/StatusEffect/StatusEffectsSystem.cs
Content.Shared/Storage/EntitySystems/SharedItemCounterSystem.cs
Content.Shared/Storage/EntitySystems/SharedItemMapperSystem.cs
Content.Shared/SubFloor/SharedSubFloorHideSystem.cs
Content.Shared/Tabletop/SharedTabletopSystem.cs
Content.Shared/Throwing/ThrownItemSystem.cs
Content.Shared/Tools/Systems/SharedToolSystem.MultipleTool.cs
Content.Shared/Weapons/Melee/SharedMeleeWeaponSystem.cs
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Revolver.cs
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs
Content.Shared/Xenoarchaeology/Artifact/XAE/XAEApplyComponentsSystem.cs

index 23ff23997fcc1a7ce79b470551f3bb8cb5b1aa19..3bfacb5bc6e8f3f55f5e3fa04730ba565e1de21d 100644 (file)
@@ -211,7 +211,7 @@ namespace Content.Client.Actions
             else
             {
                 var request = new RequestPerformActionEvent(GetNetEntity(action));
-                EntityManager.RaisePredictiveEvent(request);
+                RaisePredictiveEvent(request);
             }
         }
 
index b525747aa9cd61b016671dc9363e91209afb9d72..e6ea94c3a68baa0000a9e610095a3f1c8ad7f3b0 100644 (file)
@@ -168,7 +168,7 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
         _targetTime = _gameTiming.CurTime + TimeSpan.FromSeconds(_cooldown);
 
         var player = _playerManager.LocalEntity;
-        if (!EntityManager.TryGetComponent(player, out TransformComponent? xform))
+        if (!TryComp(player, out TransformComponent? xform))
         {
             ClearSounds();
             return;
index 24d339dfce096668ce4b43b10dc1fe445c1b29a5..0e7557724fd28b01b7ca96ada7754c2b71585cbc 100644 (file)
@@ -286,14 +286,14 @@ namespace Content.Client.Construction
             if (!CheckConstructionConditions(prototype, loc, dir, user, showPopup: true))
                 return false;
 
-            ghost = EntityManager.SpawnEntity("constructionghost", loc);
-            var comp = EntityManager.GetComponent<ConstructionGhostComponent>(ghost.Value);
+            ghost = Spawn("constructionghost", loc);
+            var comp = Comp<ConstructionGhostComponent>(ghost.Value);
             comp.Prototype = prototype;
             comp.GhostId = ghost.GetHashCode();
-            EntityManager.GetComponent<TransformComponent>(ghost.Value).LocalRotation = dir.ToAngle();
+            Comp<TransformComponent>(ghost.Value).LocalRotation = dir.ToAngle();
             _ghosts.Add(comp.GhostId, ghost.Value);
 
-            var sprite = EntityManager.GetComponent<SpriteComponent>(ghost.Value);
+            var sprite = Comp<SpriteComponent>(ghost.Value);
             _sprite.SetColor((ghost.Value, sprite), new Color(48, 255, 48, 128));
 
             if (targetProto.TryGetComponent(out IconComponent? icon, EntityManager.ComponentFactory))
@@ -306,7 +306,7 @@ namespace Content.Client.Construction
             else if (targetProto.Components.TryGetValue("Sprite", out _))
             {
                 var dummy = EntityManager.SpawnEntity(targetProtoId, MapCoordinates.Nullspace);
-                var targetSprite = EntityManager.EnsureComponent<SpriteComponent>(dummy);
+                var targetSprite = EnsureComp<SpriteComponent>(dummy);
                 EntityManager.System<AppearanceSystem>().OnChangeData(dummy, targetSprite);
 
                 for (var i = 0; i < targetSprite.AllLayers.Count(); i++)
@@ -325,7 +325,7 @@ namespace Content.Client.Construction
                     _sprite.LayerSetVisible((ghost.Value, sprite), i, true);
                 }
 
-                EntityManager.DeleteEntity(dummy);
+                Del(dummy);
             }
             else
                 return false;
@@ -367,7 +367,7 @@ namespace Content.Client.Construction
         {
             foreach (var ghost in _ghosts)
             {
-                if (EntityManager.GetComponent<TransformComponent>(ghost.Value).Coordinates.Equals(loc))
+                if (Comp<TransformComponent>(ghost.Value).Coordinates.Equals(loc))
                     return true;
             }
 
@@ -384,7 +384,7 @@ namespace Content.Client.Construction
                 throw new ArgumentException($"Can't start construction for a ghost with no prototype. Ghost id: {ghostId}");
             }
 
-            var transform = EntityManager.GetComponent<TransformComponent>(ghostId);
+            var transform = Comp<TransformComponent>(ghostId);
             var msg = new TryStartStructureConstructionMessage(GetNetCoordinates(transform.Coordinates), ghostComp.Prototype.ID, transform.LocalRotation, ghostId.GetHashCode());
             RaiseNetworkEvent(msg);
         }
@@ -405,7 +405,7 @@ namespace Content.Client.Construction
             if (!_ghosts.TryGetValue(ghostId, out var ghost))
                 return;
 
-            EntityManager.QueueDeleteEntity(ghost);
+            QueueDel(ghost);
             _ghosts.Remove(ghostId);
         }
 
@@ -416,7 +416,7 @@ namespace Content.Client.Construction
         {
             foreach (var ghost in _ghosts.Values)
             {
-                EntityManager.QueueDeleteEntity(ghost);
+                QueueDel(ghost);
             }
 
             _ghosts.Clear();
index 9f0496e578c26d25d43d99450e64a94229c08061..03856729770e4f9e9f5d769d4cb632a15c6b4355 100644 (file)
@@ -110,7 +110,7 @@ namespace Content.Client.Examine
         {
             var entity = args.EntityUid;
 
-            if (!args.EntityUid.IsValid() || !EntityManager.EntityExists(entity))
+            if (!args.EntityUid.IsValid() || !Exists(entity))
             {
                 return false;
             }
@@ -225,7 +225,7 @@ namespace Content.Client.Examine
 
             vBox.AddChild(hBox);
 
-            if (EntityManager.HasComponent<SpriteComponent>(target))
+            if (HasComp<SpriteComponent>(target))
             {
                 var spriteView = new SpriteView
                 {
index d49f483664ed06449dd009e7b67c7888d4044b9a..03e743697148e534d6d520f9d0b940a69a6ad1f2 100644 (file)
@@ -61,7 +61,7 @@ public sealed partial class TriggerSystem
 
     private void OnProximityInit(EntityUid uid, TriggerOnProximityComponent component, ComponentInit args)
     {
-        EntityManager.EnsureComponent<AnimationPlayerComponent>(uid);
+        EnsureComp<AnimationPlayerComponent>(uid);
     }
 
     private void OnProxAppChange(EntityUid uid, TriggerOnProximityComponent component, ref AppearanceChangeEvent args)
index 37bc9b1232de152989abcd2a500a22d05f1dc073..26133135851074a5940203d313cce938b9788928 100644 (file)
@@ -135,28 +135,28 @@ namespace Content.Client.Hands.Systems
             {
                 // use item in hand
                 // it will always be attack_self() in my heart.
-                EntityManager.RaisePredictiveEvent(new RequestUseInHandEvent());
+                RaisePredictiveEvent(new RequestUseInHandEvent());
                 return;
             }
 
             if (handName != hands.ActiveHandId && pressedEntity == null)
             {
                 // change active hand
-                EntityManager.RaisePredictiveEvent(new RequestSetHandEvent(handName));
+                RaisePredictiveEvent(new RequestSetHandEvent(handName));
                 return;
             }
 
             if (handName != hands.ActiveHandId && pressedEntity != null && activeEntity != null)
             {
                 // use active item on held item
-                EntityManager.RaisePredictiveEvent(new RequestHandInteractUsingEvent(handName));
+                RaisePredictiveEvent(new RequestHandInteractUsingEvent(handName));
                 return;
             }
 
             if (handName != hands.ActiveHandId && pressedEntity != null && activeEntity == null)
             {
                 // move the item to the active hand
-                EntityManager.RaisePredictiveEvent(new RequestMoveHandItemEvent(handName));
+                RaisePredictiveEvent(new RequestMoveHandItemEvent(handName));
             }
         }
 
@@ -166,7 +166,7 @@ namespace Content.Client.Hands.Systems
         /// </summary>
         public void UIHandActivate(string handName)
         {
-            EntityManager.RaisePredictiveEvent(new RequestActivateInHandEvent(handName));
+            RaisePredictiveEvent(new RequestActivateInHandEvent(handName));
         }
 
         public void UIInventoryExamine(string handName)
index d9897c56e255da71f1e0c462abc6765b4ad67359..6700cf2a18d762546aa84a32e33bc73803177ee7 100644 (file)
@@ -36,7 +36,7 @@ public sealed class HumanoidAppearanceSystem : SharedHumanoidAppearanceSystem
 
     private void OnCvarChanged(bool value)
     {
-        var humanoidQuery = EntityManager.AllEntityQueryEnumerator<HumanoidAppearanceComponent, SpriteComponent>();
+        var humanoidQuery = AllEntityQuery<HumanoidAppearanceComponent, SpriteComponent>();
         while (humanoidQuery.MoveNext(out var uid, out var humanoidComp, out var spriteComp))
         {
             UpdateSprite((uid, humanoidComp, spriteComp));
index dce401eefda54e62fba516d0a434c8ff29ea57a6..de58077e4417acedd138e734d18fe443f0a0fade 100644 (file)
@@ -194,12 +194,12 @@ namespace Content.Client.Inventory
 
         public void UIInventoryActivate(string slot)
         {
-            EntityManager.RaisePredictiveEvent(new UseSlotNetworkMessage(slot));
+            RaisePredictiveEvent(new UseSlotNetworkMessage(slot));
         }
 
         public void UIInventoryStorageActivate(string slot)
         {
-            EntityManager.RaisePredictiveEvent(new OpenSlotStorageNetworkMessage(slot));
+            RaisePredictiveEvent(new OpenSlotStorageNetworkMessage(slot));
         }
 
         public void UIInventoryExamine(string slot, EntityUid uid)
@@ -223,7 +223,7 @@ namespace Content.Client.Inventory
             if (!TryGetSlotEntity(uid, slot, out var item))
                 return;
 
-            EntityManager.RaisePredictiveEvent(
+            RaisePredictiveEvent(
                 new InteractInventorySlotEvent(GetNetEntity(item.Value), altInteract: false));
         }
 
@@ -232,7 +232,7 @@ namespace Content.Client.Inventory
             if (!TryGetSlotEntity(uid, slot, out var item))
                 return;
 
-            EntityManager.RaisePredictiveEvent(new InteractInventorySlotEvent(GetNetEntity(item.Value), altInteract: true));
+            RaisePredictiveEvent(new InteractInventorySlotEvent(GetNetEntity(item.Value), altInteract: true));
         }
 
         protected override void UpdateInventoryTemplate(Entity<InventoryComponent> ent)
index 5b823946f79950256445717378d7c278f00930f6..d4eaad3882682e7c1177ed988529dcff605099c8 100644 (file)
@@ -63,7 +63,7 @@ public sealed class LightBehaviorSystem : EntitySystem
     /// </summary>
     private void CopyLightSettings(Entity<LightBehaviourComponent> entity, string property)
     {
-        if (EntityManager.TryGetComponent(entity, out PointLightComponent? light))
+        if (TryComp(entity, out PointLightComponent? light))
         {
             var propertyValue = AnimationHelper.GetAnimatableProperty(light, property);
             if (propertyValue != null)
@@ -73,7 +73,7 @@ public sealed class LightBehaviorSystem : EntitySystem
         }
         else
         {
-            Log.Warning($"{EntityManager.GetComponent<MetaDataComponent>(entity).EntityName} has a {nameof(LightBehaviourComponent)} but it has no {nameof(PointLightComponent)}! Check the prototype!");
+            Log.Warning($"{Comp<MetaDataComponent>(entity).EntityName} has a {nameof(LightBehaviourComponent)} but it has no {nameof(PointLightComponent)}! Check the prototype!");
         }
     }
 
@@ -84,7 +84,7 @@ public sealed class LightBehaviorSystem : EntitySystem
     /// </summary>
     public void StartLightBehaviour(Entity<LightBehaviourComponent> entity, string id = "")
     {
-        if (!EntityManager.TryGetComponent(entity, out AnimationPlayerComponent? animation))
+        if (!TryComp(entity, out AnimationPlayerComponent? animation))
         {
             return;
         }
@@ -113,7 +113,7 @@ public sealed class LightBehaviorSystem : EntitySystem
     /// <param name="resetToOriginalSettings">Should the light have its original settings applied?</param>
     public void StopLightBehaviour(Entity<LightBehaviourComponent> entity, string id = "", bool removeBehaviour = false, bool resetToOriginalSettings = false)
     {
-        if (!EntityManager.TryGetComponent(entity, out AnimationPlayerComponent? animation))
+        if (!TryComp(entity, out AnimationPlayerComponent? animation))
         {
             return;
         }
@@ -143,7 +143,7 @@ public sealed class LightBehaviorSystem : EntitySystem
             comp.Animations.Remove(container);
         }
 
-        if (resetToOriginalSettings && EntityManager.TryGetComponent(entity, out PointLightComponent? light))
+        if (resetToOriginalSettings && TryComp(entity, out PointLightComponent? light))
         {
             foreach (var (property, value) in comp.OriginalPropertyValues)
             {
@@ -161,7 +161,7 @@ public sealed class LightBehaviorSystem : EntitySystem
     public bool HasRunningBehaviours(Entity<LightBehaviourComponent> entity)
     {
         //var uid = Owner;
-        if (!EntityManager.TryGetComponent(entity, out AnimationPlayerComponent? animation))
+        if (!TryComp(entity, out AnimationPlayerComponent? animation))
         {
             return false;
         }
index 2ff567e69efb97199172f073ce88f97048714391..37888d16c2929a54283cfe44cb25e381a265e227 100644 (file)
@@ -33,7 +33,7 @@ public sealed class MarkerSystem : EntitySystem
 
     private void UpdateVisibility(EntityUid uid)
     {
-        if (EntityManager.TryGetComponent(uid, out SpriteComponent? sprite))
+        if (TryComp(uid, out SpriteComponent? sprite))
         {
             _sprite.SetVisible((uid, sprite), MarkersVisible);
         }
index 9824ccac29ce07c19ba2d0a60b5478ac24dc75b1..144c489a5462dcb111c38a093467f1d321418607 100644 (file)
@@ -64,7 +64,7 @@ public sealed class OrbitVisualsSystem : EntitySystem
     {
         base.FrameUpdate(frameTime);
 
-        var query = EntityManager.EntityQueryEnumerator<OrbitVisualsComponent, SpriteComponent>();
+        var query = EntityQueryEnumerator<OrbitVisualsComponent, SpriteComponent>();
         while (query.MoveNext(out var uid, out var orbit, out var sprite))
         {
             var progress = (float)(_timing.CurTime.TotalSeconds / orbit.OrbitLength) % 1;
index abc717642c86cdbc7b999c6c7a93ba18aca42fca..99a84fa23ba5ad27097ad4eebbc083e24305cd80 100644 (file)
@@ -90,7 +90,7 @@ namespace Content.Client.Sandbox
 
             // Try copy entity.
             if (uid.IsValid()
-                && EntityManager.TryGetComponent(uid, out MetaDataComponent? comp)
+                && TryComp(uid, out MetaDataComponent? comp)
                 && !comp.EntityDeleted)
             {
                 if (comp.EntityPrototype == null || comp.EntityPrototype.HideSpawnMenu || comp.EntityPrototype.Abstract)
index f83b0e0bd02f30c9465b3a37705b8141a2ed8252..25d5907b055ac47adc74d133f57149260b682cb4 100644 (file)
@@ -131,7 +131,7 @@ namespace Content.Client.Tabletop
             // Get the camera entity that the server has created for us
             var camera = GetEntity(msg.CameraUid);
 
-            if (!EntityManager.TryGetComponent<EyeComponent>(camera, out var eyeComponent))
+            if (!TryComp<EyeComponent>(camera, out var eyeComponent))
             {
                 // If there is no eye, print error and do not open any window
                 Log.Error("Camera entity does not have eye component!");
@@ -258,7 +258,7 @@ namespace Content.Client.Tabletop
         private void StopDragging(bool broadcast = true)
         {
             // Set the dragging player on the component to noone
-            if (broadcast && _draggedEntity != null && EntityManager.HasComponent<TabletopDraggableComponent>(_draggedEntity.Value))
+            if (broadcast && _draggedEntity != null && HasComp<TabletopDraggableComponent>(_draggedEntity.Value))
             {
                 RaisePredictiveEvent(new TabletopMoveEvent(GetNetEntity(_draggedEntity.Value), Transforms.GetMapCoordinates(_draggedEntity.Value), GetNetEntity(_table!.Value)));
                 RaisePredictiveEvent(new TabletopDraggingPlayerChangedEvent(GetNetEntity(_draggedEntity.Value), false));
index 92596f9dc0e978d78f3073558cf993b712c9253d..77b8531888f81c78accc5b41946cb8967dbeaeb2 100644 (file)
@@ -225,7 +225,7 @@ namespace Content.Client.Verbs
                 // is this a client exclusive (gui) verb?
                 ExecuteVerb(verb, user, GetEntity(target));
             else
-                EntityManager.RaisePredictiveEvent(new ExecuteVerbEvent(target, verb));
+                RaisePredictiveEvent(new ExecuteVerbEvent(target, verb));
         }
 
         private void HandleVerbResponse(VerbsResponseEvent msg)
index de2f4e42b19eae7cdc1e659e0bd0eae2e907568e..dd26effb3328a198e1b1e625bf953a58c9dd26bb 100644 (file)
@@ -178,7 +178,7 @@ public sealed partial class GunSystem : SharedGunSystem
         if (_inputSystem.CmdStates.GetState(useKey) != BoundKeyState.Down && !gun.BurstActivated)
         {
             if (gun.ShotCounter != 0)
-                EntityManager.RaisePredictiveEvent(new RequestStopShootEvent { Gun = GetNetEntity(gunUid) });
+                RaisePredictiveEvent(new RequestStopShootEvent { Gun = GetNetEntity(gunUid) });
             return;
         }
 
@@ -190,7 +190,7 @@ public sealed partial class GunSystem : SharedGunSystem
         if (mousePos.MapId == MapId.Nullspace)
         {
             if (gun.ShotCounter != 0)
-                EntityManager.RaisePredictiveEvent(new RequestStopShootEvent { Gun = GetNetEntity(gunUid) });
+                RaisePredictiveEvent(new RequestStopShootEvent { Gun = GetNetEntity(gunUid) });
 
             return;
         }
@@ -204,7 +204,7 @@ public sealed partial class GunSystem : SharedGunSystem
 
         Log.Debug($"Sending shoot request tick {Timing.CurTick} / {Timing.CurTime}");
 
-        EntityManager.RaisePredictiveEvent(new RequestShootEvent
+        RaisePredictiveEvent(new RequestShootEvent
         {
             Target = target,
             Coordinates = GetNetCoordinates(coordinates),
index 8cfe8fbfcda45d47f5ba79428e4081385d7084d8..52b669b09daaaf12d653460c87ec3993c45577b7 100644 (file)
@@ -28,7 +28,7 @@ namespace Content.IntegrationTests.Tests.Disposal
                 SubscribeLocalEvent<DoInsertDisposalUnitEvent>(ev =>
                 {
                     var (_, toInsert, unit) = ev;
-                    var insertTransform = EntityManager.GetComponent<TransformComponent>(toInsert);
+                    var insertTransform = Comp<TransformComponent>(toInsert);
                     // Not in a tube yet
                     Assert.That(insertTransform.ParentUid, Is.EqualTo(unit));
                 }, after: new[] { typeof(SharedDisposalUnitSystem) });
index 29f2573c2d9bd442faa1a74e683c7876dd3f394f..3e494998451c765b3c460ef8005a3b9f43ea3a94 100644 (file)
@@ -410,7 +410,7 @@ namespace Content.IntegrationTests.Tests.Networking
             {
                 var uid = GetEntity(message.Uid);
 
-                var component = EntityManager.GetComponent<PredictionTestComponent>(uid);
+                var component = Comp<PredictionTestComponent>(uid);
                 var old = component.Foo;
                 if (Allow)
                 {
index 51d35c50a451b68f79d661a7f5189a7b9ccabe5b..68bdd6b9a9502235810189acec3eb53c24ee2783 100644 (file)
@@ -113,7 +113,7 @@ public sealed class AccessOverriderSystem : SharedAccessOverriderSystem
 
         if (component.TargetAccessReaderId is { Valid: true } accessReader)
         {
-            targetLabel = Loc.GetString("access-overrider-window-target-label") + " " + EntityManager.GetComponent<MetaDataComponent>(component.TargetAccessReaderId).EntityName;
+            targetLabel = Loc.GetString("access-overrider-window-target-label") + " " + Comp<MetaDataComponent>(component.TargetAccessReaderId).EntityName;
             targetLabelColor = Color.White;
 
             if (!_accessReader.GetMainAccessReader(accessReader, out var accessReaderEnt))
@@ -125,7 +125,7 @@ public sealed class AccessOverriderSystem : SharedAccessOverriderSystem
 
         if (component.PrivilegedIdSlot.Item is { Valid: true } idCard)
         {
-            privilegedIdName = EntityManager.GetComponent<MetaDataComponent>(idCard).EntityName;
+            privilegedIdName = Comp<MetaDataComponent>(idCard).EntityName;
 
             if (component.TargetAccessReaderId is { Valid: true })
             {
index 9fd30ffcb1f2e891b175f62d7a70b00f7e4d8e78..62dfddbb5890cfddd7b5dcc67b1e45c327148758 100644 (file)
@@ -73,7 +73,7 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
         List<ProtoId<AccessLevelPrototype>>? possibleAccess = null;
         if (component.PrivilegedIdSlot.Item is { Valid: true } item)
         {
-            privilegedIdName = EntityManager.GetComponent<MetaDataComponent>(item).EntityName;
+            privilegedIdName = Comp<MetaDataComponent>(item).EntityName;
             possibleAccess = _accessReader.FindAccessTags(item).ToList();
         }
 
@@ -95,8 +95,8 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
         }
         else
         {
-            var targetIdComponent = EntityManager.GetComponent<IdCardComponent>(targetId);
-            var targetAccessComponent = EntityManager.GetComponent<AccessComponent>(targetId);
+            var targetIdComponent = Comp<IdCardComponent>(targetId);
+            var targetAccessComponent = Comp<AccessComponent>(targetId);
 
             var jobProto = targetIdComponent.JobPrototype ?? new ProtoId<AccessLevelPrototype>(string.Empty);
             if (TryComp<StationRecordKeyStorageComponent>(targetId, out var keyStorage)
index 05ee45b463b6cfe418f6080696cb767917616c32..0fef62d9708162e6052749a7aee18317703d405d 100644 (file)
@@ -47,12 +47,12 @@ public sealed class IdCardSystem : SharedIdCardSystem
                 {
                     _popupSystem.PopupCoordinates(Loc.GetString("id-card-component-microwave-burnt", ("id", uid)),
                      transformComponent.Coordinates, PopupType.Medium);
-                    EntityManager.SpawnEntity("FoodBadRecipe",
+                    Spawn("FoodBadRecipe",
                         transformComponent.Coordinates);
                 }
                 _adminLogger.Add(LogType.Action, LogImpact.Medium,
                     $"{ToPrettyString(args.Microwave)} burnt {ToPrettyString(uid):entity}");
-                EntityManager.QueueDeleteEntity(uid);
+                QueueDel(uid);
                 return;
             }
 
index 95c6578a947b7ee336836872c20af7e939a9a647..56bbc225cc2e1cb3f8925fa4a84029e77c421062 100644 (file)
@@ -224,7 +224,7 @@ public sealed class AdminSystem : EntitySystem
         // Visible (identity) name can be different from real name
         if (session?.AttachedEntity != null)
         {
-            entityName = EntityManager.GetComponent<MetaDataComponent>(session.AttachedEntity.Value).EntityName;
+            entityName = Comp<MetaDataComponent>(session.AttachedEntity.Value).EntityName;
             identityName = Identity.Name(session.AttachedEntity.Value, EntityManager);
         }
 
index 1ae0543073e6419d87995b7b6665c485a4883569..442c76870940b2548b4d7543037a7dff1a0a2a3c 100644 (file)
@@ -83,7 +83,7 @@ public sealed partial class AdminVerbSystem
     // All smite verbs have names so invokeverb works.
     private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
     {
-        if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
+        if (!TryComp(args.User, out ActorComponent? actor))
             return;
 
         var player = actor.PlayerSession;
@@ -622,7 +622,7 @@ public sealed partial class AdminVerbSystem
             Icon = new SpriteSpecifier.Rsi(new ("/Textures/Objects/Materials/materials.rsi"), "ash"),
             Act = () =>
             {
-                EntityManager.QueueDeleteEntity(args.Target);
+                QueueDel(args.Target);
                 Spawn("Ash", Transform(args.Target).Coordinates);
                 _popupSystem.PopupEntity(Loc.GetString("admin-smite-turned-ash-other", ("name", args.Target)), args.Target, PopupType.LargeCaution);
             },
index 22a1ccadc92904d50cd0813bfe68f37c90165783..6e88d59be66f6d7fad20acfa95ff5abc19db6eca 100644 (file)
@@ -58,7 +58,7 @@ public sealed partial class AdminVerbSystem
 
     private void AddTricksVerbs(GetVerbsEvent<Verb> args)
     {
-        if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
+        if (!TryComp(args.User, out ActorComponent? actor))
             return;
 
         var player = actor.PlayerSession;
index 15ec7da4670732ebcb1f1ece62c7ae96b95061e3..b5ddc4bb1980fd235f47f5aed77da6ae11f7a2bd 100644 (file)
@@ -88,7 +88,7 @@ namespace Content.Server.Administration.Systems
 
         private void AddAdminVerbs(GetVerbsEvent<Verb> args)
         {
-            if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
+            if (!TryComp(args.User, out ActorComponent? actor))
                 return;
 
             var player = actor.PlayerSession;
@@ -395,7 +395,7 @@ namespace Content.Server.Administration.Systems
 
         private void AddDebugVerbs(GetVerbsEvent<Verb> args)
         {
-            if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
+            if (!TryComp(args.User, out ActorComponent? actor))
                 return;
 
             var player = actor.PlayerSession;
@@ -408,7 +408,7 @@ namespace Content.Server.Administration.Systems
                     Text = Loc.GetString("delete-verb-get-data-text"),
                     Category = VerbCategory.Debug,
                     Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/delete_transparent.svg.192dpi.png")),
-                    Act = () => EntityManager.DeleteEntity(args.Target),
+                    Act = () => Del(args.Target),
                     Impact = LogImpact.Medium,
                     ConfirmationPopup = true
                 };
@@ -451,7 +451,7 @@ namespace Content.Server.Administration.Systems
             // Make Sentient verb
             if (_groupController.CanCommand(player, "makesentient") &&
                 args.User != args.Target &&
-                !EntityManager.HasComponent<MindContainerComponent>(args.Target))
+                !HasComp<MindContainerComponent>(args.Target))
             {
                 Verb verb = new()
                 {
@@ -517,7 +517,7 @@ namespace Content.Server.Administration.Systems
 
             // Get Disposal tube direction verb
             if (_groupController.CanCommand(player, "tubeconnections") &&
-                EntityManager.TryGetComponent(args.Target, out DisposalTubeComponent? tube))
+                TryComp(args.Target, out DisposalTubeComponent? tube))
             {
                 Verb verb = new()
                 {
@@ -544,7 +544,7 @@ namespace Content.Server.Administration.Systems
             }
 
             if (_groupController.CanAdminMenu(player) &&
-                EntityManager.TryGetComponent(args.Target, out ConfigurationComponent? config))
+                TryComp(args.Target, out ConfigurationComponent? config))
             {
                 Verb verb = new()
                 {
@@ -558,7 +558,7 @@ namespace Content.Server.Administration.Systems
 
             // Add verb to open Solution Editor
             if (_groupController.CanCommand(player, "addreagent") &&
-                EntityManager.HasComponent<SolutionContainerManagerComponent>(args.Target))
+                HasComp<SolutionContainerManagerComponent>(args.Target))
             {
                 Verb verb = new()
                 {
index a2e25f269a6ac8f96331fc3cf9949b3d00ccff68..4276eafd60d92de6117f4c1c2038c312925a4dbc 100644 (file)
@@ -246,7 +246,7 @@ public sealed class AmeControllerSystem : EntitySystem
             return;
 
         var humanReadableState = value ? "Inject" : "Not inject";
-        _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{EntityManager.ToPrettyString(user.Value):player} has set the AME to {humanReadableState}");
+        _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(user.Value):player} has set the AME to {humanReadableState}");
     }
 
     public void ToggleInjecting(EntityUid uid, EntityUid? user = null, AmeControllerComponent? controller = null)
@@ -281,7 +281,7 @@ public sealed class AmeControllerSystem : EntitySystem
 
         var logImpact = (oldValue <= safeLimit && value > safeLimit) ? LogImpact.Extreme : LogImpact.Medium;
 
-        _adminLogger.Add(LogType.Action, logImpact, $"{EntityManager.ToPrettyString(user.Value):player} has set the AME to inject {controller.InjectionAmount} while set to {humanReadableState}");
+        _adminLogger.Add(LogType.Action, logImpact, $"{ToPrettyString(user.Value):player} has set the AME to inject {controller.InjectionAmount} while set to {humanReadableState}");
     }
 
     public void AdjustInjectionAmount(EntityUid uid, int delta, EntityUid? user = null, AmeControllerComponent? controller = null)
index a0e52e9b48853197533cc0f7129a543e3b952f64..1e8ed8cdf3af2e1f1abb28a697d4a8155701786c 100644 (file)
@@ -29,7 +29,7 @@ public sealed class BlockGameArcadeSystem : EntitySystem
 
     public override void Update(float frameTime)
     {
-        var query = EntityManager.EntityQueryEnumerator<BlockGameArcadeComponent>();
+        var query = EntityQueryEnumerator<BlockGameArcadeComponent>();
         while (query.MoveNext(out var _, out var blockGame))
         {
             blockGame.Game?.GameTick(frameTime);
index 2070ab8bfec6397915713860b2bb18c1daaf7d7f..bb717c7012e81bc0947c7c09ea0222d091a241ac 100644 (file)
@@ -42,7 +42,7 @@ public sealed partial class SpaceVillainArcadeSystem : EntitySystem
         if (arcade.RewardAmount <= 0)
             return;
 
-        EntityManager.SpawnEntity(_random.Pick(arcade.PossibleRewards), xform.Coordinates);
+        Spawn(_random.Pick(arcade.PossibleRewards), xform.Coordinates);
         arcade.RewardAmount--;
     }
 
index a7debbdc80dd51fb38f6b5ffb6e33288705e62cb..3cce1c956edb1dce80b6f4bd7c2f650b0a2bb7d9 100644 (file)
@@ -497,7 +497,7 @@ public sealed class AtmosMonitoringConsoleSystem : SharedAtmosMonitoringConsoleS
         if (component.NavMapBlip == null)
             return;
 
-        var netEntity = EntityManager.GetNetEntity(uid);
+        var netEntity = GetNetEntity(uid);
         var query = AllEntityQuery<AtmosMonitoringConsoleComponent, TransformComponent>();
 
         while (query.MoveNext(out var ent, out var entConsole, out var entXform))
@@ -531,7 +531,7 @@ public sealed class AtmosMonitoringConsoleSystem : SharedAtmosMonitoringConsoleS
         if (component.NavMapBlip == null)
             return;
 
-        var netEntity = EntityManager.GetNetEntity(uid);
+        var netEntity = GetNetEntity(uid);
         var query = AllEntityQuery<AtmosMonitoringConsoleComponent>();
 
         while (query.MoveNext(out var ent, out var entConsole))
index cd07da71127ce12889c96baf78cca4b5148fb9bc..4a108b38a4ee88e571eb4c601fc655cfd0c13950 100644 (file)
@@ -122,7 +122,7 @@ namespace Content.Server.Atmos.EntitySystems
 
         public void InvalidatePosition(Entity<MapGridComponent?> grid, Vector2i pos)
         {
-            var query = EntityManager.GetEntityQuery<AirtightComponent>();
+            var query = GetEntityQuery<AirtightComponent>();
             _explosionSystem.UpdateAirtightMap(grid, pos, grid, query);
             _atmosphereSystem.InvalidateTile(grid.Owner, pos);
         }
index 59320ba67bae1d9b4f1a2ad317b82be5e6719091..02d389b2153766873c4110bd41af276476cc3953 100644 (file)
@@ -390,10 +390,10 @@ namespace Content.Server.Atmos.EntitySystems
             // Note: This is still processed even if space wind is turned off since this handles playing the sounds.
 
             var number = 0;
-            var bodies = EntityManager.GetEntityQuery<PhysicsComponent>();
-            var xforms = EntityManager.GetEntityQuery<TransformComponent>();
-            var metas = EntityManager.GetEntityQuery<MetaDataComponent>();
-            var pressureQuery = EntityManager.GetEntityQuery<MovedByPressureComponent>();
+            var bodies = GetEntityQuery<PhysicsComponent>();
+            var xforms = GetEntityQuery<TransformComponent>();
+            var metas = GetEntityQuery<MetaDataComponent>();
+            var pressureQuery = GetEntityQuery<MovedByPressureComponent>();
 
             while (atmosphere.CurrentRunTiles.TryDequeue(out var tile))
             {
index 0cb40627abfa4a494f85d293e6956e8bb0cf883c..13b3e480c918272c0479205efc3180cd0b17dff4 100644 (file)
@@ -119,7 +119,7 @@ namespace Content.Server.Atmos.EntitySystems
 
             var otherEnt = args.OtherEntity;
 
-            if (!EntityManager.TryGetComponent(otherEnt, out FlammableComponent? flammable))
+            if (!TryComp(otherEnt, out FlammableComponent? flammable))
                 return;
 
             //Only ignite when the colliding fixture is projectile or ignition.
index 918b0f33ff162758cb92428fabdcb64f2e9d2cdc..b6bc4bd303389aaa8cf63975e141bc829d8c9ed0 100644 (file)
@@ -82,7 +82,7 @@ public sealed class AtmosAlarmableSystem : EntitySystem
     {
         if (component.IgnoreAlarms) return;
 
-        if (!EntityManager.TryGetComponent(uid, out DeviceNetworkComponent? netConn))
+        if (!TryComp(uid, out DeviceNetworkComponent? netConn))
             return;
 
         if (!args.Data.TryGetValue(DeviceNetworkConstants.Command, out string? cmd)
index f77897940962563e8634494140e668e01cb18a5e..9645b0a133e7c9cfb5911b0e9f08b58fb1df189d 100644 (file)
@@ -39,7 +39,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
         private void OnExamined(Entity<GasRecyclerComponent> ent, ref ExaminedEvent args)
         {
             var comp = ent.Comp;
-            if (!EntityManager.GetComponent<TransformComponent>(ent).Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
+            if (!Comp<TransformComponent>(ent).Anchored || !args.IsInDetailsRange) // Not anchored? Out of range? No status.
                 return;
 
             if (!_nodeContainer.TryGetNode(ent.Owner, comp.InletName, out PipeNode? inlet))
index dcb08dcd574e16af12bc7269302fa55ebd7d8a30..91f70467b423a3e657423fbb98c45f26f397ff81 100644 (file)
@@ -18,7 +18,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
 
         private void OnStartup(EntityUid uid, AtmosPipeColorComponent component, ComponentStartup args)
         {
-            if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
+            if (!TryComp(uid, out AppearanceComponent? appearance))
                 return;
 
             _appearance.SetData(uid, PipeColorVisuals.Color, component.Color, appearance);
@@ -26,7 +26,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
 
         private void OnShutdown(EntityUid uid, AtmosPipeColorComponent component, ComponentShutdown args)
         {
-            if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
+            if (!TryComp(uid, out AppearanceComponent? appearance))
                 return;
 
             _appearance.SetData(uid, PipeColorVisuals.Color, Color.White, appearance);
@@ -36,7 +36,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
         {
             component.Color = color;
 
-            if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
+            if (!TryComp(uid, out AppearanceComponent? appearance))
                 return;
 
             _appearance.SetData(uid, PipeColorVisuals.Color, color, appearance);
index 25439736c7c99eb97f438e50ec7400da19c808ec..398d90995271a44d4f015326f9a0060afb248e41 100644 (file)
@@ -29,7 +29,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
 
         private void OnUnanchorAttempt(EntityUid uid, AtmosUnsafeUnanchorComponent component, UnanchorAttemptEvent args)
         {
-            if (!component.Enabled || !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodes))
+            if (!component.Enabled || !TryComp(uid, out NodeContainerComponent? nodes))
                 return;
 
             if (_atmosphere.GetContainingMixture(uid, true) is not {} environment)
@@ -78,7 +78,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
         /// </summary>
         public void LeakGas(EntityUid uid, bool removeFromPipe = true)
         {
-            if (!EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodes))
+            if (!TryComp(uid, out NodeContainerComponent? nodes))
                 return;
 
             if (_atmosphere.GetContainingMixture(uid, true, true) is not { } environment)
index c5a91895b2e277509e653303b622cb1cb2acfa68..8d0fb8ad2cfd280ed039c871cda3b16a4dd05bd2 100644 (file)
@@ -103,10 +103,10 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
             if (args.Handled || !args.Complex)
                 return;
 
-            if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
+            if (!TryComp(args.User, out ActorComponent? actor))
                 return;
 
-            if (EntityManager.GetComponent<TransformComponent>(uid).Anchored)
+            if (Comp<TransformComponent>(uid).Anchored)
             {
                 _userInterfaceSystem.OpenUi(uid, GasFilterUiKey.Key, actor.PlayerSession);
                 DirtyUI(uid, filter);
index 0852051487bbe04351d43d8701887dc602c00b88..84abede06658fdda9f405d16aaa5fef723d18d2d 100644 (file)
@@ -143,7 +143,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
             if (args.Handled || !args.Complex)
                 return;
 
-            if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
+            if (!TryComp(args.User, out ActorComponent? actor))
                 return;
 
             if (Transform(uid).Anchored)
@@ -165,7 +165,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
                 return;
 
             _userInterfaceSystem.SetUiState(uid, GasMixerUiKey.Key,
-                new GasMixerBoundUserInterfaceState(EntityManager.GetComponent<MetaDataComponent>(uid).EntityName, mixer.TargetPressure, mixer.Enabled, mixer.InletOneConcentration));
+                new GasMixerBoundUserInterfaceState(Comp<MetaDataComponent>(uid).EntityName, mixer.TargetPressure, mixer.Enabled, mixer.InletOneConcentration));
         }
 
         private void UpdateAppearance(EntityUid uid, GasMixerComponent? mixer = null, AppearanceComponent? appearance = null)
@@ -200,7 +200,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
             mixer.InletOneConcentration = nodeOne;
             mixer.InletTwoConcentration = 1.0f - mixer.InletOneConcentration;
             _adminLogger.Add(LogType.AtmosRatioChanged, LogImpact.Medium,
-                $"{EntityManager.ToPrettyString(args.Actor):player} set the ratio on {EntityManager.ToPrettyString(uid):device} to {mixer.InletOneConcentration}:{mixer.InletTwoConcentration}");
+                $"{ToPrettyString(args.Actor):player} set the ratio on {ToPrettyString(uid):device} to {mixer.InletOneConcentration}:{mixer.InletTwoConcentration}");
             DirtyUI(uid, mixer);
         }
 
index c277352b6fb95521389db08bccf9161de3ae41aa..682a59cb7548b3e759ae682b187121ef7b40957d 100644 (file)
@@ -27,7 +27,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
 
         private void OnPortableAnchorAttempt(EntityUid uid, GasPortableComponent component, AnchorAttemptEvent args)
         {
-            if (!EntityManager.TryGetComponent(uid, out TransformComponent? transform))
+            if (!TryComp(uid, out TransformComponent? transform))
                 return;
 
             // If we can't find any ports, cancel the anchoring.
@@ -52,7 +52,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
 
             foreach (var entityUid in _mapSystem.GetLocal(gridId.Value, grid, coordinates))
             {
-                if (EntityManager.TryGetComponent(entityUid, out port))
+                if (TryComp(entityUid, out port))
                 {
                     return true;
                 }
index 013668613a245df066a3215cd670bbbb2127ef19..1066e4e88d3beac719df8f1064342ea1115c7a17 100644 (file)
@@ -218,7 +218,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
 
         private void OnPacketRecv(EntityUid uid, GasVentPumpComponent component, DeviceNetworkPacketEvent args)
         {
-            if (!EntityManager.TryGetComponent(uid, out DeviceNetworkComponent? netConn)
+            if (!TryComp(uid, out DeviceNetworkComponent? netConn)
                 || !args.Data.TryGetValue(DeviceNetworkConstants.Command, out var cmd))
                 return;
 
index b5c8a9c1a94b4a2ccd2c39c5ece0e3d8059bcae5..22f22a682a065a04e9da789f0c0b7d716fa6598b 100644 (file)
@@ -148,7 +148,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
 
         private void OnPacketRecv(EntityUid uid, GasVentScrubberComponent component, DeviceNetworkPacketEvent args)
         {
-            if (!EntityManager.TryGetComponent(uid, out DeviceNetworkComponent? netConn)
+            if (!TryComp(uid, out DeviceNetworkComponent? netConn)
                 || !args.Data.TryGetValue(DeviceNetworkConstants.Command, out var cmd))
                 return;
 
index d9033a0f9426fcd5ad2fa3b29518105354ebb08e..2aabb5eb27070fa7e95556503ac4f5adeb47386d 100644 (file)
@@ -79,7 +79,7 @@ namespace Content.Server.Bible
                 // Clean up the old body
                 if (summonableComp.Summon != null)
                 {
-                    EntityManager.DeleteEntity(summonableComp.Summon.Value);
+                    Del(summonableComp.Summon.Value);
                     summonableComp.Summon = null;
                 }
                 summonableComp.AlreadySummoned = false;
@@ -235,7 +235,7 @@ namespace Content.Server.Bible
                 return;
 
             // Make this familiar the component's summon
-            var familiar = EntityManager.SpawnEntity(component.SpecialItemPrototype, position.Coordinates);
+            var familiar = Spawn(component.SpecialItemPrototype, position.Coordinates);
             component.Summon = familiar;
 
             // If this is going to use a ghost role mob spawner, attach it to the bible.
index aecba50dff9a4fc21ca05c6637906e00d122716b..862bf1f096c24add0d686dbb4e66b0e7f7b51e5b 100644 (file)
@@ -626,7 +626,7 @@ namespace Content.Server.Cargo.Systems
             _transformSystem.Unanchor(item, Transform(item));
 
             // Create a sheet of paper to write the order details on
-            var printed = EntityManager.SpawnEntity(paperProto, spawn);
+            var printed = Spawn(paperProto, spawn);
             if (TryComp<PaperComponent>(printed, out var paper))
             {
                 // fill in the order data
index 8118ca855578f93cabc70ea97937c3f4cf1cbd91..66934c8a8714aeb9e5841188f0069d6327bf8e6a 100644 (file)
@@ -47,7 +47,7 @@ public sealed class NanoTaskCartridgeSystem : SharedNanoTaskCartridgeSystem
         {
             return;
         }
-        if (!EntityManager.TryGetComponent<NanoTaskPrintedComponent>(args.Used, out var printed))
+        if (!TryComp<NanoTaskPrintedComponent>(args.Used, out var printed))
         {
             return;
         }
@@ -55,7 +55,7 @@ public sealed class NanoTaskCartridgeSystem : SharedNanoTaskCartridgeSystem
         {
             program.Tasks.Add(new(program.Counter++, printed.Task));
             args.Handled = true;
-            EntityManager.DeleteEntity(args.Used);
+            Del(args.Used);
             UpdateUiState(new Entity<NanoTaskCartridgeComponent>(uid.Value, program), ent.Owner);
         }
     }
index 8727429fc98e24a6368e322eece0811c9a436acf..9ae50a8c97e0d44148fcdf2e97d30c5cf3c14214 100644 (file)
@@ -51,7 +51,7 @@ public sealed class SuicideSystem : EntitySystem
         if (!TryComp<MobStateComponent>(victim, out var mobState) || _mobState.IsDead(victim, mobState))
             return false;
 
-        _adminLogger.Add(LogType.Mind, $"{EntityManager.ToPrettyString(victim):player} is attempting to suicide");
+        _adminLogger.Add(LogType.Mind, $"{ToPrettyString(victim):player} is attempting to suicide");
 
         ICommonSession? session = null;
 
@@ -77,7 +77,7 @@ public sealed class SuicideSystem : EntitySystem
         }
         else
         {
-            _adminLogger.Add(LogType.Mind, $"{EntityManager.ToPrettyString(victim):player} suicided.");
+            _adminLogger.Add(LogType.Mind, $"{ToPrettyString(victim):player} suicided.");
         }
         return true;
     }
index 50d5a778f3e8da94d8999b971f71f2c811c3ab79..2d6fb3c2754ce58739f0d8750c2e9834596774fb 100644 (file)
@@ -390,7 +390,7 @@ public sealed partial class ChatSystem : SharedChatSystem
             return;
         }
 
-        if (!EntityManager.TryGetComponent<StationDataComponent>(station, out var stationDataComp)) return;
+        if (!TryComp<StationDataComponent>(station, out var stationDataComp)) return;
 
         var filter = _stationSystem.GetInStation(stationDataComp);
 
index 4020a114c89db8b944e64d7ac35da96c92315f3e..d4e03b0967744bee233506f3418fe90dcf5fa7ef 100644 (file)
@@ -32,7 +32,7 @@ namespace Content.Server.Chemistry.EntitySystems.DeleteOnSolutionEmptySystem
 
             if (_solutionContainerSystem.TryGetSolution((entity.Owner, solutions), entity.Comp.Solution, out _, out var solution))
                 if (solution.Volume <= 0)
-                    EntityManager.QueueDeleteEntity(entity);
+                    QueueDel(entity);
         }
     }
 }
index 62303c2e359f15714e8fce7d13d21b95d0cc23f8..f53688a24102d259d4c55edf9ca6d344d2e01a33 100644 (file)
@@ -176,12 +176,12 @@ public sealed class InjectorSystem : SharedInjectorSystem
             if (injector.Comp.ToggleState == InjectorToggleMode.Inject)
             {
                 AdminLogger.Add(LogType.ForceFeed,
-                    $"{EntityManager.ToPrettyString(user):user} is attempting to inject {EntityManager.ToPrettyString(target):target} with a solution {SharedSolutionContainerSystem.ToPrettyString(solution):solution}");
+                    $"{ToPrettyString(user):user} is attempting to inject {ToPrettyString(target):target} with a solution {SharedSolutionContainerSystem.ToPrettyString(solution):solution}");
             }
             else
             {
                 AdminLogger.Add(LogType.ForceFeed,
-                    $"{EntityManager.ToPrettyString(user):user} is attempting to draw {injector.Comp.TransferAmount.ToString()} units from {EntityManager.ToPrettyString(target):target}");
+                    $"{ToPrettyString(user):user} is attempting to draw {injector.Comp.TransferAmount.ToString()} units from {ToPrettyString(target):target}");
             }
         }
         else
@@ -192,12 +192,12 @@ public sealed class InjectorSystem : SharedInjectorSystem
             if (injector.Comp.ToggleState == InjectorToggleMode.Inject)
             {
                 AdminLogger.Add(LogType.Ingestion,
-                    $"{EntityManager.ToPrettyString(user):user} is attempting to inject themselves with a solution {SharedSolutionContainerSystem.ToPrettyString(solution):solution}.");
+                    $"{ToPrettyString(user):user} is attempting to inject themselves with a solution {SharedSolutionContainerSystem.ToPrettyString(solution):solution}.");
             }
             else
             {
                 AdminLogger.Add(LogType.ForceFeed,
-                    $"{EntityManager.ToPrettyString(user):user} is attempting to draw {injector.Comp.TransferAmount.ToString()} units from themselves.");
+                    $"{ToPrettyString(user):user} is attempting to draw {injector.Comp.TransferAmount.ToString()} units from themselves.");
             }
         }
 
index 55489e0b3148f571a4349521f38aee74cf95373c..a6725856ec4fad9891c2357fed953e5184ba11e9 100644 (file)
@@ -39,7 +39,7 @@ namespace Content.Server.Chemistry.EntitySystems
 
         private void HandleCollide(Entity<VaporComponent> entity, ref StartCollideEvent args)
         {
-            if (!EntityManager.TryGetComponent(entity.Owner, out SolutionContainerManagerComponent? contents)) return;
+            if (!TryComp(entity.Owner, out SolutionContainerManagerComponent? contents)) return;
 
             foreach (var (_, soln) in _solutionContainerSystem.EnumerateSolutions((entity.Owner, contents)))
             {
@@ -50,7 +50,7 @@ namespace Content.Server.Chemistry.EntitySystems
             // Check for collision with a impassable object (e.g. wall) and stop
             if ((args.OtherFixture.CollisionLayer & (int)CollisionGroup.Impassable) != 0 && args.OtherFixture.Hard)
             {
-                EntityManager.QueueDeleteEntity(entity);
+                QueueDel(entity);
             }
         }
 
@@ -67,7 +67,7 @@ namespace Content.Server.Chemistry.EntitySystems
             despawn.Lifetime = aliveTime;
 
             // Set Move
-            if (EntityManager.TryGetComponent(vapor, out PhysicsComponent? physics))
+            if (TryComp(vapor, out PhysicsComponent? physics))
             {
                 _physics.SetLinearDamping(vapor, physics, 0f);
                 _physics.SetAngularDamping(vapor, physics, 0f);
@@ -156,7 +156,7 @@ namespace Content.Server.Chemistry.EntitySystems
 
                         // Delete the vapor entity if it has no contents
                         if (contents.Volume == 0)
-                            EntityManager.QueueDeleteEntity(uid);
+                            QueueDel(uid);
 
                     }
 
index 594c5ebbb69a57838b44aace9b09d4c1a53e8c2f..588b0c75a53ca08e0baa67a3055daba133b0649d 100644 (file)
@@ -80,7 +80,7 @@ public sealed class CloningPodSystem : EntitySystem
     internal void TransferMindToClone(EntityUid mindId, MindComponent mind)
     {
         if (!ClonesWaitingForMind.TryGetValue(mind, out var entity) ||
-            !EntityManager.EntityExists(entity) ||
+            !Exists(entity) ||
             !TryComp<MindContainerComponent>(entity, out var mindComp) ||
             mindComp.Mind != null)
             return;
@@ -93,11 +93,11 @@ public sealed class CloningPodSystem : EntitySystem
     private void HandleMindAdded(EntityUid uid, BeingClonedComponent clonedComponent, MindAddedMessage message)
     {
         if (clonedComponent.Parent == EntityUid.Invalid ||
-            !EntityManager.EntityExists(clonedComponent.Parent) ||
+            !Exists(clonedComponent.Parent) ||
             !TryComp<CloningPodComponent>(clonedComponent.Parent, out var cloningPodComponent) ||
             uid != cloningPodComponent.BodyContainer.ContainedEntity)
         {
-            EntityManager.RemoveComponent<BeingClonedComponent>(uid);
+            RemComp<BeingClonedComponent>(uid);
             return;
         }
         UpdateStatus(clonedComponent.Parent, CloningPodStatus.Cloning, cloningPodComponent);
@@ -139,7 +139,7 @@ public sealed class CloningPodSystem : EntitySystem
         var mind = mindEnt.Comp;
         if (ClonesWaitingForMind.TryGetValue(mind, out var clone))
         {
-            if (EntityManager.EntityExists(clone) &&
+            if (Exists(clone) &&
                 !_mobStateSystem.IsDead(clone) &&
                 TryComp<MindContainerComponent>(clone, out var cloneMindComp) &&
                 (cloneMindComp.Mind == null || cloneMindComp.Mind == mindEnt))
@@ -204,7 +204,7 @@ public sealed class CloningPodSystem : EntitySystem
             return false;
         }
 
-        var cloneMindReturn = EntityManager.AddComponent<BeingClonedComponent>(mob.Value);
+        var cloneMindReturn = AddComp<BeingClonedComponent>(mob.Value);
         cloneMindReturn.Mind = mind;
         cloneMindReturn.Parent = uid;
         _containerSystem.Insert(mob.Value, clonePod.BodyContainer);
@@ -272,7 +272,7 @@ public sealed class CloningPodSystem : EntitySystem
         if (clonePod.BodyContainer.ContainedEntity is not { Valid: true } entity || clonePod.CloningProgress < clonePod.CloningTime)
             return;
 
-        EntityManager.RemoveComponent<BeingClonedComponent>(entity);
+        RemComp<BeingClonedComponent>(entity);
         _containerSystem.Remove(entity, clonePod.BodyContainer);
         clonePod.CloningProgress = 0f;
         clonePod.UsedBiomass = 0;
index effbc2159e64c3d3526f6330c59e85d566ceeb35..97ab41e7b1c538189197f29f85c2b6e7489be0c5 100644 (file)
@@ -175,7 +175,7 @@ public sealed partial class CloningSystem : EntitySystem
         if (prototype == null)
             return null;
 
-        var spawned = EntityManager.SpawnAtPosition(prototype, coords);
+        var spawned = SpawnAtPosition(prototype, coords);
 
         // copy over important component data
         var ev = new CloningItemEvent(spawned);
index 54f0e936b4ea31f971474843296dd4e329ae0628..bd655e61d0f27e02bb8b967e34b27f40add9ae37 100644 (file)
@@ -56,7 +56,7 @@ public sealed class CodewordSystem : EntitySystem
         var factionProto = _prototypeManager.Index<CodewordFactionPrototype>(faction.Id);
 
         var codewords = GenerateCodewords(factionProto.Generator);
-        var codewordsContainer = EntityManager.Spawn(protoName:null, MapCoordinates.Nullspace);
+        var codewordsContainer = Spawn(prototype: null, MapCoordinates.Nullspace);
         EnsureComp<CodewordComponent>(codewordsContainer)
             .Codewords = codewords;
         manager.Codewords[faction] = codewordsContainer;
index 6951d44b4d55e8fd8a92fd698f0fbf91c740dbaa..a35491ca1063b05cba15220164987f6c44a0f014 100644 (file)
@@ -60,7 +60,7 @@ public sealed partial class ConstructionSystem
         if (container.ContainedEntities.Count != 0)
             return;
 
-        var board = EntityManager.SpawnEntity(component.BoardPrototype, Transform(ent).Coordinates);
+        var board = Spawn(component.BoardPrototype, Transform(ent).Coordinates);
 
         if (!_container.Insert(board, container))
             Log.Warning($"Couldn't insert board {board} to computer {ent}!");
index 7d4dd6153dc07b817c4b096e9fe01e1af0f67fff..a3f3bcc42ab6bd6462f98a6217aac366600f26a2 100644 (file)
@@ -325,7 +325,7 @@ namespace Content.Server.Construction
             var newUid = EntityManager.CreateEntityUninitialized(newEntity, transform.Coordinates);
 
             // Construction transferring.
-            var newConstruction = EntityManager.EnsureComponent<ConstructionComponent>(newUid);
+            var newConstruction = EnsureComp<ConstructionComponent>(newUid);
 
             // Transfer all construction-owned containers.
             newConstruction.Containers.UnionWith(construction.Containers);
@@ -372,7 +372,7 @@ namespace Content.Server.Construction
             if (containerManager != null)
             {
                 // Ensure the new entity has a container manager. Also for resolve goodness.
-                var newContainerManager = EntityManager.EnsureComponent<ContainerManagerComponent>(newUid);
+                var newContainerManager = EnsureComp<ContainerManagerComponent>(newUid);
 
                 // Transfer all construction-owned containers from the old entity to the new one.
                 foreach (var container in construction.Containers)
index 767399335ae15534306e2a285b3081eb133d0d45..3739951a6f251508d0ba516567d245a7ff5eec23 100644 (file)
@@ -69,7 +69,7 @@ namespace Content.Server.Construction
                     if(!containerSlot.ContainedEntity.HasValue)
                         continue;
 
-                    if (EntityManager.TryGetComponent(containerSlot.ContainedEntity.Value, out StorageComponent? storage))
+                    if (TryComp(containerSlot.ContainedEntity.Value, out StorageComponent? storage))
                     {
                         foreach (var storedEntity in storage.Container.ContainedEntities)
                         {
@@ -270,7 +270,7 @@ namespace Content.Server.Construction
             }
 
             var newEntityProto = graph.Nodes[edge.Target].Entity.GetId(null, user, new(EntityManager));
-            var newEntity = EntityManager.SpawnAttachedTo(newEntityProto, coords, rotation: angle);
+            var newEntity = SpawnAttachedTo(newEntityProto, coords, rotation: angle);
 
             if (!TryComp(newEntity, out ConstructionComponent? construction))
             {
@@ -471,7 +471,7 @@ namespace Content.Server.Construction
             }
 
             if (!_actionBlocker.CanInteract(user, null)
-                || !EntityManager.TryGetComponent(user, out HandsComponent? hands) || _handsSystem.GetActiveItem((user, hands)) == null)
+                || !TryComp(user, out HandsComponent? hands) || _handsSystem.GetActiveItem((user, hands)) == null)
             {
                 Cleanup();
                 return;
index 343143b9bd4c11d957431b023712e725576b6bad..fa031038d3755da1ec052a43d5d0110918c9b2f2 100644 (file)
@@ -41,13 +41,13 @@ namespace Content.Server.Construction
             var construction = ent.Comp;
             if (GetCurrentGraph(ent, construction) is not {} graph)
             {
-                Log.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid graph specified.");
+                Log.Warning($"Prototype {Comp<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid graph specified.");
                 return;
             }
 
             if (GetNodeFromGraph(graph, construction.Node) is not {} node)
             {
-                Log.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid node specified.");
+                Log.Warning($"Prototype {Comp<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid node specified.");
                 return;
             }
 
@@ -56,7 +56,7 @@ namespace Content.Server.Construction
             {
                 if (GetEdgeFromNode(node, edgeIndex) is not {} currentEdge)
                 {
-                    Log.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid edge index specified.");
+                    Log.Warning($"Prototype {Comp<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid edge index specified.");
                     return;
                 }
 
@@ -67,7 +67,7 @@ namespace Content.Server.Construction
             {
                 if (GetNodeFromGraph(graph, targetNodeId) is not { } targetNode)
                 {
-                    Log.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid target node specified.");
+                    Log.Warning($"Prototype {Comp<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid target node specified.");
                     return;
                 }
 
index f2597cd424682b933da94adec34d9bb8ccad7021..f3abc2bf7a86a386118e7f1f708f41326bc7f905 100644 (file)
@@ -76,7 +76,7 @@ public sealed class CrayonSystem : SharedCrayonSystem
         component.Charges--;
         Dirty(uid, component);
 
-        _adminLogger.Add(LogType.CrayonDraw, LogImpact.Low, $"{EntityManager.ToPrettyString(args.User):user} drew a {component.Color:color} {component.SelectedState}");
+        _adminLogger.Add(LogType.CrayonDraw, LogImpact.Low, $"{ToPrettyString(args.User):user} drew a {component.Color:color} {component.SelectedState}");
         args.Handled = true;
 
         if (component.DeleteEmpty && component.Charges <= 0)
@@ -143,6 +143,6 @@ public sealed class CrayonSystem : SharedCrayonSystem
     private void UseUpCrayon(EntityUid uid, EntityUid user)
     {
         _popup.PopupEntity(Loc.GetString("crayon-interact-used-up-text", ("owner", uid)), user, user);
-        EntityManager.QueueDeleteEntity(uid);
+        QueueDel(uid);
     }
 }
index 5980455e49c1fcdf0559b1b4348f1c624f35b0ef..8c0e0a13825c19d9312b6a0079beff062498adfe 100644 (file)
@@ -31,7 +31,7 @@ namespace Content.Server.Damage.Systems
                 return;
 
             if (component.WeldingDamage is {} weldingDamage
-            && EntityManager.TryGetComponent(args.Used, out WelderComponent? welder)
+            && TryComp(args.Used, out WelderComponent? welder)
             && itemToggle.Activated
             && !welder.TankSafe)
             {
index 288732bb0ae47964c23e785c43b043ba66ac01f7..5edcdae8ac6cceeee37dd06942d5a72f676c2312 100644 (file)
@@ -29,7 +29,7 @@ namespace Content.Server.DeviceNetwork.Systems
         /// </summary>
         private void OnBeforePacketSent(EntityUid uid, ApcNetworkComponent receiver, BeforePacketSentEvent args)
         {
-            if (!EntityManager.TryGetComponent(args.Sender, out ApcNetworkComponent? sender)) return;
+            if (!TryComp(args.Sender, out ApcNetworkComponent? sender)) return;
 
             if (sender.ConnectedNode?.NodeGroup == null || !sender.ConnectedNode.NodeGroup.Equals(receiver.ConnectedNode?.NodeGroup))
             {
@@ -39,7 +39,7 @@ namespace Content.Server.DeviceNetwork.Systems
 
         private void OnProviderConnected(EntityUid uid, ApcNetworkComponent component, ExtensionCableSystem.ProviderConnectedEvent args)
         {
-            if (!EntityManager.TryGetComponent(args.Provider.Owner, out NodeContainerComponent? nodeContainer)) return;
+            if (!TryComp(args.Provider.Owner, out NodeContainerComponent? nodeContainer)) return;
 
             if (_nodeContainer.TryGetNode(nodeContainer, "power", out CableNode? node))
             {
index 588020a9636b1d2722d5359e68523b321894a954..8f513130d1ce57e7f635ec41d6f252b1ce65dab2 100644 (file)
@@ -24,7 +24,7 @@ namespace Content.Server.DeviceNetwork.Systems.Devices
         /// </summary>
         private void OnInteracted(EntityUid uid, ApcNetSwitchComponent component, InteractHandEvent args)
         {
-            if (!EntityManager.TryGetComponent(uid, out DeviceNetworkComponent? networkComponent)) return;
+            if (!TryComp(uid, out DeviceNetworkComponent? networkComponent)) return;
 
             component.State = !component.State;
 
@@ -47,7 +47,7 @@ namespace Content.Server.DeviceNetwork.Systems.Devices
         /// </summary>
         private void OnPackedReceived(EntityUid uid, ApcNetSwitchComponent component, DeviceNetworkPacketEvent args)
         {
-            if (!EntityManager.TryGetComponent(uid, out DeviceNetworkComponent? networkComponent) || args.SenderAddress == networkComponent.Address) return;
+            if (!TryComp(uid, out DeviceNetworkComponent? networkComponent) || args.SenderAddress == networkComponent.Address) return;
             if (!args.Data.TryGetValue(DeviceNetworkConstants.Command, out string? command) || command != DeviceNetworkConstants.CmdSetState) return;
             if (!args.Data.TryGetValue(DeviceNetworkConstants.StateEnabled, out bool enabled)) return;
 
index f1e094db20558a5ddc7f9867557814ab6842b59d..24653ce8d4035dbb6a7ae649db8c231b4034b51e 100644 (file)
@@ -102,7 +102,7 @@ namespace Content.Server.Disposal.Tube
         /// <param name="msg">A user interface message from the client.</param>
         private void OnUiAction(EntityUid uid, DisposalRouterComponent router, SharedDisposalRouterComponent.UiActionMessage msg)
         {
-            if (!EntityManager.EntityExists(msg.Actor))
+            if (!Exists(msg.Actor))
                 return;
 
             if (TryComp<PhysicsComponent>(uid, out var physBody) && physBody.BodyType != BodyType.Static)
index a94176246c1df3bdbebaf7677164625aba91dc25..091a91c14e5f20b67e3883862aac6710393ded75 100644 (file)
@@ -156,7 +156,7 @@ namespace Content.Server.Disposal.Unit
                 holder.Air.Clear();
             }
 
-            EntityManager.DeleteEntity(uid);
+            Del(uid);
         }
 
         // Note: This function will cause an ExitDisposals on any failure that does not make an ExitDisposals impossible.
@@ -243,7 +243,7 @@ namespace Content.Server.Disposal.Unit
                 holder.TimeLeft -= time;
                 frameTime -= time;
 
-                if (!EntityManager.EntityExists(holder.CurrentTube))
+                if (!Exists(holder.CurrentTube))
                 {
                     ExitDisposals(uid, holder);
                     break;
@@ -268,7 +268,7 @@ namespace Content.Server.Disposal.Unit
 
                 // Find next tube
                 var nextTube = _disposalTubeSystem.NextTubeFor(currentTube, holder.CurrentDirection);
-                if (!EntityManager.EntityExists(nextTube))
+                if (!Exists(nextTube))
                 {
                     ExitDisposals(uid, holder);
                     break;
index 94994a38b81bcb71a6e5a7b28d49b8be31bd75fd..743646c92b649a92058c8b9ebd42719e379cb5fc 100644 (file)
@@ -63,13 +63,13 @@ namespace Content.Server.Engineering.EntitySystems
             if (component.Deleted || !IsTileClear())
                 return;
 
-            if (EntityManager.TryGetComponent(uid, out StackComponent? stackComp)
+            if (TryComp(uid, out StackComponent? stackComp)
                 && component.RemoveOnInteract && !_stackSystem.Use(uid, 1, stackComp))
             {
                 return;
             }
 
-            EntityManager.SpawnEntity(component.Prototype, args.ClickLocation.SnapToGrid(grid));
+            Spawn(component.Prototype, args.ClickLocation.SnapToGrid(grid));
 
             if (component.RemoveOnInteract && stackComp == null)
                 TryQueueDel(uid);
index 49ed9866d4e58c4c30345639da6cd233e0a704f1..98853a0e61b446e82f34283c049ca3db7009f604 100644 (file)
@@ -518,7 +518,7 @@ public sealed class EntityEffectSystem : EntitySystem
 
             var spreadAmount = (int) Math.Max(0, Math.Ceiling((reagentArgs.Quantity / args.Effect.OverflowThreshold).Float()));
             var splitSolution = reagentArgs.Source.SplitSolution(reagentArgs.Source.Volume);
-            var transform = EntityManager.GetComponent<TransformComponent>(reagentArgs.TargetEntity);
+            var transform = Comp<TransformComponent>(reagentArgs.TargetEntity);
             var mapCoords = _xform.GetMapCoordinates(reagentArgs.TargetEntity, xform: transform);
 
             if (!_mapManager.TryFindGridAt(mapCoords, out var gridUid, out var grid) ||
@@ -531,7 +531,7 @@ public sealed class EntityEffectSystem : EntitySystem
                 return;
 
             var coords = _map.MapToGrid(gridUid, mapCoords);
-            var ent = EntityManager.SpawnEntity(args.Effect.PrototypeId, coords.SnapToGrid());
+            var ent = Spawn(args.Effect.PrototypeId, coords.SnapToGrid());
 
             _smoke.StartSmoke(ent, splitSolution, args.Effect.Duration, spreadAmount);
 
@@ -641,7 +641,7 @@ public sealed class EntityEffectSystem : EntitySystem
 
     private void OnExecuteEmpReactionEffect(ref ExecuteEntityEffectEvent<EmpReactionEffect> args)
     {
-        var transform = EntityManager.GetComponent<TransformComponent>(args.Args.TargetEntity);
+        var transform = Comp<TransformComponent>(args.Args.TargetEntity);
 
         var range = args.Effect.EmpRangePerUnit;
 
@@ -697,7 +697,7 @@ public sealed class EntityEffectSystem : EntitySystem
 
     private void OnExecuteFlashReactionEffect(ref ExecuteEntityEffectEvent<FlashReactionEffect> args)
     {
-        var transform = EntityManager.GetComponent<TransformComponent>(args.Args.TargetEntity);
+        var transform = Comp<TransformComponent>(args.Args.TargetEntity);
 
         var range = 1f;
 
@@ -764,7 +764,7 @@ public sealed class EntityEffectSystem : EntitySystem
         ghostRole = AddComp<GhostRoleComponent>(uid);
         EnsureComp<GhostTakeoverAvailableComponent>(uid);
 
-        var entityData = EntityManager.GetComponent<MetaDataComponent>(uid);
+        var entityData = Comp<MetaDataComponent>(uid);
         ghostRole.RoleName = entityData.EntityName;
         ghostRole.RoleDescription = Loc.GetString("ghost-role-information-cognizine-description");
     }
@@ -847,7 +847,7 @@ public sealed class EntityEffectSystem : EntitySystem
 
     private void OnExecutePlantMutateChemicals(ref ExecuteEntityEffectEvent<PlantMutateChemicals> args)
     {
-        var plantholder = EntityManager.GetComponent<PlantHolderComponent>(args.Args.TargetEntity);
+        var plantholder = Comp<PlantHolderComponent>(args.Args.TargetEntity);
 
         if (plantholder.Seed == null)
             return;
@@ -881,7 +881,7 @@ public sealed class EntityEffectSystem : EntitySystem
 
     private void OnExecutePlantMutateConsumeGasses(ref ExecuteEntityEffectEvent<PlantMutateConsumeGasses> args)
     {
-        var plantholder = EntityManager.GetComponent<PlantHolderComponent>(args.Args.TargetEntity);
+        var plantholder = Comp<PlantHolderComponent>(args.Args.TargetEntity);
 
         if (plantholder.Seed == null)
             return;
@@ -903,7 +903,7 @@ public sealed class EntityEffectSystem : EntitySystem
 
     private void OnExecutePlantMutateExudeGasses(ref ExecuteEntityEffectEvent<PlantMutateExudeGasses> args)
     {
-        var plantholder = EntityManager.GetComponent<PlantHolderComponent>(args.Args.TargetEntity);
+        var plantholder = Comp<PlantHolderComponent>(args.Args.TargetEntity);
 
         if (plantholder.Seed == null)
             return;
@@ -925,7 +925,7 @@ public sealed class EntityEffectSystem : EntitySystem
 
     private void OnExecutePlantMutateHarvest(ref ExecuteEntityEffectEvent<PlantMutateHarvest> args)
     {
-        var plantholder = EntityManager.GetComponent<PlantHolderComponent>(args.Args.TargetEntity);
+        var plantholder = Comp<PlantHolderComponent>(args.Args.TargetEntity);
 
         if (plantholder.Seed == null)
             return;
@@ -938,7 +938,7 @@ public sealed class EntityEffectSystem : EntitySystem
 
     private void OnExecutePlantSpeciesChange(ref ExecuteEntityEffectEvent<PlantSpeciesChange> args)
     {
-        var plantholder = EntityManager.GetComponent<PlantHolderComponent>(args.Args.TargetEntity);
+        var plantholder = Comp<PlantHolderComponent>(args.Args.TargetEntity);
         if (plantholder.Seed == null)
             return;
 
index d7546e2eb080f5c64ba07802062711bdbb593dea..480974e28f31b17bf4e80ad8bbd65fc3eb57f42d 100644 (file)
@@ -51,7 +51,7 @@ namespace Content.Server.Examine
             var entity = GetEntity(request.NetEntity);
 
             if (session.AttachedEntity is not {Valid: true} playerEnt
-                || !EntityManager.EntityExists(entity))
+                || !Exists(entity))
             {
                 RaiseNetworkEvent(new ExamineSystemMessages.ExamineInfoResponseMessage(
                     request.NetEntity, request.Id, _entityNotFoundMessage), channel);
index adc2e14f69355777591f38cef531f926e9f1e7a4..af004e112e95fdf8e7fcd159c4dae31caaaa2a2c 100644 (file)
@@ -66,9 +66,9 @@ public sealed partial class ExplosionSystem
         if (!_airtightMap.ContainsKey(gridId))
             _airtightMap[gridId] = new();
 
-        query ??= EntityManager.GetEntityQuery<AirtightComponent>();
-        var damageQuery = EntityManager.GetEntityQuery<DamageableComponent>();
-        var destructibleQuery = EntityManager.GetEntityQuery<DestructibleComponent>();
+        query ??= GetEntityQuery<AirtightComponent>();
+        var damageQuery = GetEntityQuery<DamageableComponent>();
+        var destructibleQuery = GetEntityQuery<DestructibleComponent>();
         var anchoredEnumerator = _mapSystem.GetAnchoredEntitiesEnumerator(gridId, grid, tile);
 
         while (anchoredEnumerator.MoveNext(out var uid))
@@ -99,7 +99,7 @@ public sealed partial class ExplosionSystem
         if (!airtight.AirBlocked)
             return;
 
-        if (!EntityManager.TryGetComponent(uid, out TransformComponent? transform) || !transform.Anchored)
+        if (!TryComp(uid, out TransformComponent? transform) || !transform.Anchored)
             return;
 
         if (!TryComp<MapGridComponent>(transform.GridUid, out var grid))
index b067b2b62669cf83a6bb5c02ce6a89e0503923dd..8515e1af42cfc8efa5c6807f71f7c5a4545e6e77 100644 (file)
@@ -102,7 +102,7 @@ public sealed partial class ExplosionSystem
                 continue;
             }
 
-            var xforms = EntityManager.GetEntityQuery<TransformComponent>();
+            var xforms = GetEntityQuery<TransformComponent>();
             var xform = xforms.GetComponent(gridToTransform);
             var  (_, gridWorldRotation, gridWorldMatrix, invGridWorldMatrid) = _transformSystem.GetWorldPositionRotationMatrixWithInv(xform, xforms);
 
index 8f25b437475b2828fa0e1681182e6b5bd8074691..ffdc90f9d63e0728a071e539f2a12c0852a9a2c3 100644 (file)
@@ -167,7 +167,7 @@ public sealed partial class ExplosionSystem : SharedExplosionSystem
             user);
 
         if (explosive.DeleteAfterExplosion ?? delete)
-            EntityManager.QueueDeleteEntity(uid);
+            QueueDel(uid);
     }
 
     /// <summary>
index b2f26309cfcb0734fbf80af9af0b212cdf4d969c..426bade10e9626625e0777af8241097668852cbc 100644 (file)
@@ -82,7 +82,7 @@ public sealed partial class TriggerSystem
 
     private void SetProximityAppearance(EntityUid uid, TriggerOnProximityComponent component)
     {
-        if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
+        if (TryComp(uid, out AppearanceComponent? appearance))
         {
             _appearance.SetData(uid, ProximityTriggerVisualState.State, component.Enabled ? ProximityTriggerVisuals.Inactive : ProximityTriggerVisuals.Off, appearance);
         }
@@ -107,7 +107,7 @@ public sealed partial class TriggerSystem
         // Queue a visual update for when the animation is complete.
         component.NextVisualUpdate = curTime + component.AnimationDuration;
 
-        if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
+        if (TryComp(uid, out AppearanceComponent? appearance))
         {
             _appearance.SetData(uid, ProximityTriggerVisualState.State, ProximityTriggerVisuals.Active, appearance);
         }
index f052eadbd54d767d23d2857bdc93d2e2cd4ad4c7..f3a3f0c87ce7eef3ffa2a00e5f8bfd6219260971 100644 (file)
@@ -202,7 +202,7 @@ namespace Content.Server.Explosion.EntitySystems
 
         private void HandleDeleteTrigger(EntityUid uid, DeleteOnTriggerComponent component, TriggerEvent args)
         {
-            EntityManager.QueueDeleteEntity(uid);
+            QueueDel(uid);
             args.Handled = true;
         }
 
index cdab2883f53a2ed2b6045a48fa8900622491ce7a..8488fd14bbd2337c6a510ff82c1a0ae25670616b 100644 (file)
@@ -36,7 +36,7 @@ public sealed class TwoStageTriggerSystem : EntitySystem
                 RemComp(uid, c);
 
             _serializationManager.CopyTo(entry.Component, ref temp);
-            EntityManager.AddComponent(uid, comp);
+            AddComp(uid, comp);
         }
         component.ComponentsIsLoaded = true;
     }
index 44a953374e5160af8e22a19e136c8b59d30e7f75..67848a4282a47912dd818d3a9ffaef5ea3aa0705 100644 (file)
@@ -591,7 +591,7 @@ public sealed class FaxSystem : EntitySystem
         var printout = component.PrintingQueue.Dequeue();
 
         var entityToSpawn = printout.PrototypeId.Length == 0 ? component.PrintPaperId.ToString() : printout.PrototypeId;
-        var printed = EntityManager.SpawnEntity(entityToSpawn, Transform(uid).Coordinates);
+        var printed = Spawn(entityToSpawn, Transform(uid).Coordinates);
 
         if (TryComp<PaperComponent>(printed, out var paper))
         {
index 974d6f1ec1fa2bacef739361b0397eeb9714e301..84718add5fec15cdd7c82f14ae20255ea6514a9b 100644 (file)
@@ -174,7 +174,7 @@ public sealed class DrainSystem : SharedDrainSystem
                     // but queuedelete should be pretty safe.
                     if (!_solutionContainerSystem.ResolveSolution(puddle.Owner, puddle.Comp.SolutionName, ref puddle.Comp.Solution, out var puddleSolution))
                     {
-                        EntityManager.QueueDeleteEntity(puddle);
+                        QueueDel(puddle);
                         continue;
                     }
 
index 88acf4b703e3c9d2cef3ecc38bd3b9c7e7459293..61e7d108a0526c9e6d53ac446b2cd837135c01e9 100644 (file)
@@ -55,7 +55,7 @@ public sealed class PuddleDebugDebugOverlaySystem : SharedPuddleDebugOverlaySyst
             if (session.AttachedEntity is not { Valid: true } entity)
                 continue;
 
-            var transform = EntityManager.GetComponent<TransformComponent>(entity);
+            var transform = Comp<TransformComponent>(entity);
 
 
             var worldBounds = Box2.CenteredAround(_transform.GetWorldPosition(transform),
index bb7b06bd0b7b80e1587a912527d5d1b16f9d53c4..ca2a2a64f322c45c1c79c00d4e50634d4a8bc6cd 100644 (file)
@@ -741,7 +741,7 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
         }
 
         var coords = _map.GridTileToLocal(gridId, mapGrid, tileRef.GridIndices);
-        puddleUid = EntityManager.SpawnEntity("Puddle", coords);
+        puddleUid = Spawn("Puddle", coords);
         EnsureComp<PuddleComponent>(puddleUid);
         if (TryAddSolution(puddleUid, solution, sound))
         {
index f0eb12c34d5b23ec390346d74039e33087207f57..87c19c688dfa4a06a3d6f2595f3476bfa87dd42e 100644 (file)
@@ -69,7 +69,7 @@ namespace Content.Server.Forensics
             if (args.Handled || args.Cancelled)
                 return;
 
-            if (!EntityManager.TryGetComponent(uid, out ForensicScannerComponent? scanner))
+            if (!TryComp(uid, out ForensicScannerComponent? scanner))
                 return;
 
             if (args.Args.Target != null)
@@ -196,7 +196,7 @@ namespace Content.Server.Forensics
             }
 
             // Spawn a piece of paper.
-            var printed = EntityManager.SpawnEntity(component.MachineOutput, Transform(uid).Coordinates);
+            var printed = Spawn(component.MachineOutput, Transform(uid).Coordinates);
             _handsSystem.PickupOrDrop(args.Actor, printed, checkActionBlocker: false);
 
             if (!TryComp<PaperComponent>(printed, out var paperComp))
index 74c8ac9539811cbb38e3f8d8e16df71f411d171f..c59028e69b3cd21f6e96a6a070f3e21d8b987a49 100644 (file)
@@ -306,7 +306,7 @@ namespace Content.Server.GameTicking
 
             if (player.UserId == new Guid("{e887eb93-f503-4b65-95b6-2f282c014192}"))
             {
-                EntityManager.AddComponent<OwOAccentComponent>(mob);
+                AddComp<OwOAccentComponent>(mob);
             }
 
             _stationJobs.TryAssignJob(station, jobPrototype, player.UserId);
@@ -426,7 +426,7 @@ namespace Content.Server.GameTicking
         public EntityCoordinates GetObserverSpawnPoint()
         {
             _possiblePositions.Clear();
-            var spawnPointQuery = EntityManager.EntityQueryEnumerator<SpawnPointComponent, TransformComponent>();
+            var spawnPointQuery = EntityQueryEnumerator<SpawnPointComponent, TransformComponent>();
             while (spawnPointQuery.MoveNext(out var uid, out var point, out var transform))
             {
                 if (point.SpawnType != SpawnPointType.Observer
index ac0455c9a774604ebd49ff4e8309bae9f4948b5d..33de2c6f39bbee8270343ecb9e75f74ae6e5a394 100644 (file)
@@ -517,9 +517,9 @@ namespace Content.Server.Ghost
             if (playerEntity != null && viaCommand)
             {
                 if (forced)
-                    _adminLog.Add(LogType.Mind, $"{EntityManager.ToPrettyString(playerEntity.Value):player} was forced to ghost via command");
+                    _adminLog.Add(LogType.Mind, $"{ToPrettyString(playerEntity.Value):player} was forced to ghost via command");
                 else
-                    _adminLog.Add(LogType.Mind, $"{EntityManager.ToPrettyString(playerEntity.Value):player} is attempting to ghost via command");
+                    _adminLog.Add(LogType.Mind, $"{ToPrettyString(playerEntity.Value):player} is attempting to ghost via command");
             }
 
             var handleEv = new GhostAttemptHandleEvent(mind, canReturnGlobal);
@@ -592,7 +592,7 @@ namespace Content.Server.Ghost
             }
 
             if (playerEntity != null)
-                _adminLog.Add(LogType.Mind, $"{EntityManager.ToPrettyString(playerEntity.Value):player} ghosted{(!canReturn ? " (non-returnable)" : "")}");
+                _adminLog.Add(LogType.Mind, $"{ToPrettyString(playerEntity.Value):player} ghosted{(!canReturn ? " (non-returnable)" : "")}");
 
             var ghost = SpawnGhost((mindId, mind), position, canReturn);
 
index 7375dee1103f76f386627eee52ba761ad1c81561..23d8a6e8eaf6159d3289bd6f50d3b3b0be11e8aa 100644 (file)
@@ -126,7 +126,7 @@ public sealed class GhostRoleSystem : EntitySystem
     public void OpenEui(ICommonSession session)
     {
         if (session.AttachedEntity is not { Valid: true } attached ||
-            !EntityManager.HasComponent<GhostComponent>(attached))
+            !HasComp<GhostComponent>(attached))
             return;
 
         if (_openUis.ContainsKey(session))
@@ -511,7 +511,7 @@ public sealed class GhostRoleSystem : EntitySystem
         DebugTools.AssertNotNull(player.ContentData());
 
         var newMind = _mindSystem.CreateMind(player.UserId,
-            EntityManager.GetComponent<MetaDataComponent>(mob).EntityName);
+            Comp<MetaDataComponent>(mob).EntityName);
 
         _mindSystem.SetUserId(newMind, player.UserId);
         _mindSystem.TransferTo(newMind, mob);
index 1ccb80b32e3b6bac6ec416eb806b40b01bf935e9..0f7b6ce3f93df12f93350aed7a7d48f9189842f5 100644 (file)
@@ -158,9 +158,9 @@ namespace Content.Server.Hands.Systems
                 return false;
             hands.NextThrowTime = _timing.CurTime + hands.ThrowCooldown;
 
-            if (EntityManager.TryGetComponent(throwEnt, out StackComponent? stack) && stack.Count > 1 && stack.ThrowIndividually)
+            if (TryComp(throwEnt, out StackComponent? stack) && stack.Count > 1 && stack.ThrowIndividually)
             {
-                var splitStack = _stackSystem.Split(throwEnt.Value, 1, EntityManager.GetComponent<TransformComponent>(player).Coordinates, stack);
+                var splitStack = _stackSystem.Split(throwEnt.Value, 1, Comp<TransformComponent>(player).Coordinates, stack);
 
                 if (splitStack is not {Valid: true})
                     return false;
index b63a54598983168bdd10eb8dc641fdb8828fa009..58ed77ecf83d46d9bb719c45c898c3e23584618a 100644 (file)
@@ -51,7 +51,7 @@ public sealed class HolosignSystem : EntitySystem
 
         // places the holographic sign at the click location, snapped to grid.
         // overlapping of the same holo on one tile remains allowed to allow holofan refreshes
-        var holoUid = EntityManager.SpawnEntity(component.SignProto, args.ClickLocation.SnapToGrid(EntityManager));
+        var holoUid = Spawn(component.SignProto, args.ClickLocation.SnapToGrid(EntityManager));
         var xform = Transform(holoUid);
         if (!xform.Anchored)
             _transform.AnchorEntity(holoUid, xform); // anchor to prevent any tempering with (don't know what could even interact with it)
index fc0e47b033d90adb9b299fa34f782d5c0dbcf269..126416daa906f7a434c4272e6b34bee69ac6a1d8 100644 (file)
@@ -51,8 +51,8 @@ public sealed class RandomHumanoidSystem : EntitySystem
             foreach (var entry in prototype.Components.Values)
             {
                 var comp = (Component)_serialization.CreateCopy(entry.Component, notNullableOverride: true);
-                EntityManager.RemoveComponent(humanoid, comp.GetType());
-                EntityManager.AddComponent(humanoid, comp);
+                RemComp(humanoid, comp.GetType());
+                AddComp(humanoid, comp);
             }
         }
 
index d881f90341f6b144bbe30ddccd8a584f0c457eaf..bcbcfda9af0019c08bea72a865c8b038f64087ff 100644 (file)
@@ -35,7 +35,7 @@ public sealed class ImmovableRodSystem : EntitySystem
         base.Update(frameTime);
 
         // we are deliberately including paused entities. rod hungers for all
-        foreach (var (rod, trans) in EntityManager.EntityQuery<ImmovableRodComponent, TransformComponent>(true))
+        foreach (var (rod, trans) in EntityQuery<ImmovableRodComponent, TransformComponent>(true))
         {
             if (!rod.DestroyTiles)
                 continue;
@@ -58,7 +58,7 @@ public sealed class ImmovableRodSystem : EntitySystem
 
     private void OnMapInit(EntityUid uid, ImmovableRodComponent component, MapInitEvent args)
     {
-        if (EntityManager.TryGetComponent(uid, out PhysicsComponent? phys))
+        if (TryComp(uid, out PhysicsComponent? phys))
         {
             _physics.SetLinearDamping(uid, phys, 0f);
             _physics.SetFriction(uid, phys, 0f);
index a347d7ea41e6f44403893cc16b8a5f543931c9c2..420bd44737e9f2c96a03724e1a73a77a3d5685be 100644 (file)
@@ -268,20 +268,20 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
 
     public (NetEntity, string)[] GetBands(EntityUid uid)
     {
-        var metadataQuery = EntityManager.GetEntityQuery<MetaDataComponent>();
+        var metadataQuery = GetEntityQuery<MetaDataComponent>();
 
         if (Deleted(uid))
             return Array.Empty<(NetEntity, string)>();
 
         var list = new ValueList<(NetEntity, string)>();
-        var instrumentQuery = EntityManager.GetEntityQuery<InstrumentComponent>();
+        var instrumentQuery = GetEntityQuery<InstrumentComponent>();
 
         if (!TryComp(uid, out InstrumentComponent? originInstrument)
             || originInstrument.InstrumentPlayer is not {} originPlayer)
             return Array.Empty<(NetEntity, string)>();
 
         // It's probably faster to get all possible active instruments than all entities in range
-        var activeEnumerator = EntityManager.EntityQueryEnumerator<ActiveInstrumentComponent>();
+        var activeEnumerator = EntityQueryEnumerator<ActiveInstrumentComponent>();
         while (activeEnumerator.MoveNext(out var entity, out _))
         {
             if (entity == uid)
@@ -424,8 +424,8 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
             _bandRequestQueue.Clear();
         }
 
-        var activeQuery = EntityManager.GetEntityQuery<ActiveInstrumentComponent>();
-        var transformQuery = EntityManager.GetEntityQuery<TransformComponent>();
+        var activeQuery = GetEntityQuery<ActiveInstrumentComponent>();
+        var transformQuery = GetEntityQuery<TransformComponent>();
 
         var query = AllEntityQuery<ActiveInstrumentComponent, InstrumentComponent>();
         while (query.MoveNext(out var uid, out _, out var instrument))
index 6d36f7457b95c8db9157fa78ae91cbb0a2a3635d..07ced93085b43c8bcc9d82637d807e40f358790b 100644 (file)
@@ -137,7 +137,7 @@ namespace Content.Server.Kitchen.EntitySystems
 
         private void OnActiveMicrowaveRemove(Entity<ActiveMicrowaveComponent> ent, ref EntRemovedFromContainerMessage args)
         {
-            EntityManager.RemoveComponentDeferred<ActivelyMicrowavedComponent>(args.Entity);
+            RemCompDeferred<ActivelyMicrowavedComponent>(args.Entity);
         }
 
         // Stop items from transforming through constructiongraphs while being microwaved.
@@ -749,7 +749,7 @@ namespace Content.Server.Kitchen.EntitySystems
             if (!HasContents(ent.Comp) || HasComp<ActiveMicrowaveComponent>(ent))
                 return;
 
-            _container.Remove(EntityManager.GetEntity(args.EntityID), ent.Comp.Storage);
+            _container.Remove(GetEntity(args.EntityID), ent.Comp.Storage);
             UpdateUserInterfaceState(ent, ent.Comp);
         }
 
index 4b4e16b5db615abb22bf6fb4eff6b09fad2b7cee..cce5fb5bd31516aec3c8381c26bf96fa7f7013c2 100644 (file)
@@ -135,9 +135,9 @@ public sealed class SharpSystem : EntitySystem
         args.Handled = true;
 
         _adminLogger.Add(LogType.Gib,
-            $"{EntityManager.ToPrettyString(args.User):user} " +
-            $"has butchered {EntityManager.ToPrettyString(args.Target):target} " +
-            $"with {EntityManager.ToPrettyString(args.Used):knife}");
+            $"{ToPrettyString(args.User):user} " +
+            $"has butchered {ToPrettyString(args.Target):target} " +
+            $"with {ToPrettyString(args.Used):knife}");
     }
 
     private void OnGetInteractionVerbs(EntityUid uid, ButcherableComponent component, GetVerbsEvent<InteractionVerb> args)
index 393f564b2fcfd01a3c261e912ab8de221f108852..f643bec73f1dec039543c5b77685b76b0fcc0011 100644 (file)
@@ -209,7 +209,7 @@ namespace Content.Server.Light.EntitySystems
 
             component.CurrentState = ExpendableLightState.BrandNew;
             component.StateExpiryTime = (float)component.GlowDuration.TotalSeconds;
-            EntityManager.EnsureComponent<PointLightComponent>(uid);
+            EnsureComp<PointLightComponent>(uid);
         }
 
         private void OnExpLightUse(Entity<ExpendableLightComponent> ent, ref UseInHandEvent args)
index b98ba156231716759a7d6e47bbcca3aedbafeb3c..b5b9f2043237c2cd33838be5d16e5af9d6551e48 100644 (file)
@@ -76,7 +76,7 @@ namespace Content.Server.Light.EntitySystems
             // TODO: Use ContainerFill dog
             if (light.HasLampOnSpawn != null)
             {
-                var entity = EntityManager.SpawnEntity(light.HasLampOnSpawn, EntityManager.GetComponent<TransformComponent>(uid).Coordinates);
+                var entity = Spawn(light.HasLampOnSpawn, Comp<TransformComponent>(uid).Coordinates);
                 _containerSystem.Insert(entity, light.LightBulbContainer);
             }
             // need this to update visualizers
@@ -134,7 +134,7 @@ namespace Content.Server.Light.EntitySystems
                 return false;
 
             // check if bulb fits
-            if (!EntityManager.TryGetComponent(bulbUid, out LightBulbComponent? lightBulb))
+            if (!TryComp(bulbUid, out LightBulbComponent? lightBulb))
                 return false;
             if (lightBulb.Type != light.BulbType)
                 return false;
@@ -226,7 +226,7 @@ namespace Content.Server.Light.EntitySystems
 
             // check bulb state
             var bulbUid = GetBulb(uid, light);
-            if (bulbUid == null || !EntityManager.TryGetComponent(bulbUid.Value, out LightBulbComponent? lightBulb))
+            if (bulbUid == null || !TryComp(bulbUid.Value, out LightBulbComponent? lightBulb))
                 return false;
             if (lightBulb.State == LightBulbState.Broken)
                 return false;
@@ -252,7 +252,7 @@ namespace Content.Server.Light.EntitySystems
 
             // check if light has bulb
             var bulbUid = GetBulb(uid, light);
-            if (bulbUid == null || !EntityManager.TryGetComponent(bulbUid.Value, out LightBulbComponent? lightBulb))
+            if (bulbUid == null || !TryComp(bulbUid.Value, out LightBulbComponent? lightBulb))
             {
                 SetLight(uid, false, light: light);
                 powerReceiver.Load = 0;
@@ -348,7 +348,7 @@ namespace Content.Server.Light.EntitySystems
 
             light.IsBlinking = isNowBlinking;
 
-            if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
+            if (!TryComp(uid, out AppearanceComponent? appearance))
                 return;
 
             _appearance.SetData(uid, PoweredLightVisuals.Blinking, isNowBlinking, appearance);
@@ -384,7 +384,7 @@ namespace Content.Server.Light.EntitySystems
             light.CurrentLit = value;
             _ambientSystem.SetAmbience(uid, value);
 
-            if (EntityManager.TryGetComponent(uid, out PointLightComponent? pointLight))
+            if (TryComp(uid, out PointLightComponent? pointLight))
             {
                 _pointLight.SetEnabled(uid, value, pointLight);
 
index 6c4a62ff0944f112061aae3d544409ae1c0d3ca9..16a7243815b54b3dafbeb3edba91a1d58abebb2f 100644 (file)
@@ -404,7 +404,7 @@ public sealed class NewsSystem : SharedNewsSystem
         if (_webhookSendDuringRound)
             return;
 
-        var query = EntityManager.EntityQueryEnumerator<StationNewsComponent>();
+        var query = EntityQueryEnumerator<StationNewsComponent>();
 
         while (query.MoveNext(out _, out var comp))
         {
index 4b408343b7a37561248ef871bc1df1496dd6d577..bfd88d53b9c06eef193ec227e25edbb2b6f2d377 100644 (file)
@@ -62,6 +62,6 @@ public sealed class MechAssemblySystem : EntitySystem
                 return;
         }
         Spawn(component.FinishedPrototype, Transform(uid).Coordinates);
-        EntityManager.DeleteEntity(uid);
+        Del(uid);
     }
 }
index acbbce9e5025db412ee2ffe70cd96dd894ec712b..c18f29d2fb3bc3b7bbae5422a9b196652ae5cae9 100644 (file)
@@ -106,12 +106,12 @@ public sealed class HealingSystem : EntitySystem
         if (entity.Owner != args.User)
         {
             _adminLogger.Add(LogType.Healed,
-                $"{EntityManager.ToPrettyString(args.User):user} healed {EntityManager.ToPrettyString(entity.Owner):target} for {total:damage} damage");
+                $"{ToPrettyString(args.User):user} healed {ToPrettyString(entity.Owner):target} for {total:damage} damage");
         }
         else
         {
             _adminLogger.Add(LogType.Healed,
-                $"{EntityManager.ToPrettyString(args.User):user} healed themselves for {total:damage} damage");
+                $"{ToPrettyString(args.User):user} healed themselves for {total:damage} damage");
         }
 
         _audio.PlayPvs(healing.HealingEndSound, entity.Owner);
index 2ab09e746fbd8f97a315ca342ad0cdb8c55d6b80..cb0fbd736c617f6aa787730e6c2c7e239255fb2e 100644 (file)
@@ -67,7 +67,7 @@ public sealed class SuitSensorSystem : EntitySystem
         base.Update(frameTime);
 
         var curTime = _gameTiming.CurTime;
-        var sensors = EntityManager.EntityQueryEnumerator<SuitSensorComponent, DeviceNetworkComponent>();
+        var sensors = EntityQueryEnumerator<SuitSensorComponent, DeviceNetworkComponent>();
 
         while (sensors.MoveNext(out var uid, out var sensor, out var device))
         {
@@ -391,7 +391,7 @@ public sealed class SuitSensorSystem : EntitySystem
 
         // get health mob state
         var isAlive = false;
-        if (EntityManager.TryGetComponent(sensor.User.Value, out MobStateComponent? mobState))
+        if (TryComp(sensor.User.Value, out MobStateComponent? mobState))
             isAlive = !_mobStateSystem.IsDead(sensor.User.Value, mobState);
 
         // get mob total damage
index 52f5ca312d1100dc4f9829ae0176634b721e55a1..387be509e94054b72108dd3f311a9bbbd4c51161 100644 (file)
@@ -134,7 +134,7 @@ public sealed class CrematoriumSystem : EntitySystem
             {
                 var item = storage.Contents.ContainedEntities[i];
                 _containers.Remove(item, storage.Contents);
-                EntityManager.DeleteEntity(item);
+                Del(item);
             }
             var ash = Spawn("Ash", Transform(uid).Coordinates);
             _containers.Insert(ash, storage.Contents);
@@ -172,7 +172,7 @@ public sealed class CrematoriumSystem : EntitySystem
         }
         else
         {
-            EntityManager.DeleteEntity(victim);
+            Del(victim);
         }
         _entityStorage.CloseStorage(uid);
         Cremate(uid, component);
index 78610be77edae9fe5973cbb0ed6b4d7f1528bcff..6a736f3bc997ede60a349384fa632dd88067fe30 100644 (file)
@@ -205,7 +205,7 @@ public sealed partial class NPCSteeringSystem : SharedNPCSteeringSystem
         if (!Resolve(uid, ref component, false))
             return;
 
-        if (EntityManager.TryGetComponent(uid, out InputMoverComponent? controller))
+        if (TryComp(uid, out InputMoverComponent? controller))
         {
             controller.CurTickSprintMovement = Vector2.Zero;
 
index 200554faa3f29e3860254ce7e926e11e1ec4cad6..5c0aca1578f9dbfc6330e0623de55ed2fdbef05b 100644 (file)
@@ -45,7 +45,7 @@ namespace Content.Server.Nutrition.EntitySystems
             var coordinates = Transform(uid).Coordinates;
             _audio.PlayPvs(_audio.ResolveSound(creamPie.Sound), coordinates, AudioParams.Default.WithVariation(0.125f));
 
-            if (EntityManager.TryGetComponent(uid, out FoodComponent? foodComp))
+            if (TryComp(uid, out FoodComponent? foodComp))
             {
                 if (_solutions.TryGetSolution(uid, foodComp.Solution, out _, out var solution))
                 {
@@ -53,12 +53,12 @@ namespace Content.Server.Nutrition.EntitySystems
                 }
                 foreach (var trash in foodComp.Trash)
                 {
-                    EntityManager.SpawnEntity(trash, Transform(uid).Coordinates);
+                    Spawn(trash, Transform(uid).Coordinates);
                 }
             }
             ActivatePayload(uid);
 
-            EntityManager.QueueDeleteEntity(uid);
+            QueueDel(uid);
         }
 
         private void OnConsume(Entity<CreamPieComponent> entity, ref ConsumeDoAfterEvent args)
index 510b9552a3df2d207dd5b56cc51e734b7456a8a7..48e5b1a0c00ccf4ce2aa6fca572e32707c3a140d 100644 (file)
@@ -21,7 +21,7 @@ namespace Content.Server.Nutrition.EntitySystems
             if (args.Handled || !args.Complex)
                 return;
 
-            if (!EntityManager.TryGetComponent(entity, out SmokableComponent? smokable))
+            if (!TryComp(entity, out SmokableComponent? smokable))
                 return;
 
             if (smokable.State != SmokableState.Lit)
@@ -36,7 +36,7 @@ namespace Content.Server.Nutrition.EntitySystems
             if (args.Handled)
                 return;
 
-            if (!EntityManager.TryGetComponent(entity, out SmokableComponent? smokable))
+            if (!TryComp(entity, out SmokableComponent? smokable))
                 return;
 
             if (smokable.State != SmokableState.Unlit)
@@ -57,7 +57,7 @@ namespace Content.Server.Nutrition.EntitySystems
             var targetEntity = args.Target;
             if (targetEntity == null ||
                 !args.CanReach ||
-                !EntityManager.TryGetComponent(entity, out SmokableComponent? smokable) ||
+                !TryComp(entity, out SmokableComponent? smokable) ||
                 smokable.State == SmokableState.Lit)
                 return;
 
index 26d86acd5450b16b3aa0002bb84f3edce412576d..9a1d64b2eb15b4444bcd0e4fb7faa488903a2731 100644 (file)
@@ -30,7 +30,7 @@ namespace Content.Server.Nutrition.EntitySystems
             if (args.Handled)
                 return;
 
-            if (!EntityManager.TryGetComponent(entity, out SmokableComponent? smokable))
+            if (!TryComp(entity, out SmokableComponent? smokable))
                 return;
 
             if (smokable.State != SmokableState.Unlit)
@@ -52,7 +52,7 @@ namespace Content.Server.Nutrition.EntitySystems
             var targetEntity = args.Target;
             if (targetEntity == null ||
                 !args.CanReach ||
-                !EntityManager.TryGetComponent(entity, out SmokableComponent? smokable) ||
+                !TryComp(entity, out SmokableComponent? smokable) ||
                 smokable.State == SmokableState.Lit)
                 return;
 
@@ -91,7 +91,7 @@ namespace Content.Server.Nutrition.EntitySystems
                 _solutionContainerSystem.TryAddSolution(pipeSolution.Value, reagentSolution);
             }
 
-            EntityManager.DeleteEntity(contents);
+            Del(contents);
 
             _itemSlotsSystem.SetLock(entity.Owner, entity.Comp.BowlSlot, true); //no inserting more until current runs out
 
index 72b8396051091ef89b919bfda5db0c8548d3ad42..fa5ec0a1bf9c3ed1bec1f6a0736774632fb08440 100644 (file)
@@ -64,7 +64,7 @@ namespace Content.Server.Nutrition.EntitySystems
             if (entity.Comp.ExplodeOnUse || _emag.CheckFlag(entity, EmagType.Interaction))
             {
                 _explosionSystem.QueueExplosion(entity.Owner, "Default", entity.Comp.ExplosionIntensity, 0.5f, 3, canCreateVacuum: false);
-                EntityManager.DeleteEntity(entity);
+                Del(entity);
                 exploded = true;
             }
             else
@@ -80,7 +80,7 @@ namespace Content.Server.Nutrition.EntitySystems
                     {
                         exploded = true;
                         _explosionSystem.QueueExplosion(entity.Owner, "Default", entity.Comp.ExplosionIntensity, 0.5f, 3, canCreateVacuum: false);
-                        EntityManager.DeleteEntity(entity);
+                        Del(entity);
                         break;
                     }
                 }
index ea3a8be9cbd3c85589b2254a1b330df6de2bc310..08ff0c1d41b10a00e11d9902182af1a01152050e 100644 (file)
@@ -33,7 +33,7 @@ namespace Content.Server.Nutrition.EntitySystems
 
         public void CheckSolutions(Entity<TrashOnSolutionEmptyComponent> entity)
         {
-            if (!EntityManager.HasComponent<SolutionContainerManagerComponent>(entity))
+            if (!HasComp<SolutionContainerManagerComponent>(entity))
                 return;
 
             if (_solutionContainerSystem.TryGetSolution(entity.Owner, entity.Comp.Solution, out _, out var solution))
index e16e8884b2192d42744bbe8627d7de4852ed886a..18444bc590dd59bcba1973b409baef1b040bda49 100644 (file)
@@ -102,7 +102,7 @@ public sealed class PayloadSystem : EntitySystem
 
             var temp = (object) component;
             _serializationManager.CopyTo(data.Component, ref temp);
-            EntityManager.AddComponent(uid, (Component) temp!);
+            AddComp(uid, (Component) temp!);
 
             trigger.GrantedComponents.Add(registration.Type);
         }
@@ -117,7 +117,7 @@ public sealed class PayloadSystem : EntitySystem
 
         foreach (var type in trigger.GrantedComponents)
         {
-            EntityManager.RemoveComponent(uid, type);
+            RemComp(uid, type);
         }
 
         trigger.GrantedComponents.Clear();
index 55d3d50d2a5c053dddca3ad61b0e88936a6ab548..fad6493524cb33723388b4573f07f2f65fad9cb5 100644 (file)
@@ -43,9 +43,9 @@ internal sealed class RandomWalkController : VirtualController
         var query = EntityQueryEnumerator<RandomWalkComponent, PhysicsComponent>();
         while (query.MoveNext(out var uid, out var randomWalk, out var physics))
         {
-            if (EntityManager.HasComponent<ActorComponent>(uid)
-            ||  EntityManager.HasComponent<ThrownItemComponent>(uid)
-            ||  EntityManager.HasComponent<FollowerComponent>(uid))
+            if (HasComp<ActorComponent>(uid)
+            || HasComp<ThrownItemComponent>(uid)
+            || HasComp<FollowerComponent>(uid))
                 continue;
 
             var curTime = _timing.CurTime;
index eebf9cbbfde826198a33e068c660ea52d772fa6b..22eb26b16b0e789d181a89281c5d6477e18d67a5 100644 (file)
@@ -144,7 +144,7 @@ public sealed class PinpointerSystem : SharedPinpointerSystem
             return;
 
         var target = pinpointer.Target;
-        if (target == null || !EntityManager.EntityExists(target.Value))
+        if (target == null || !Exists(target.Value))
         {
             SetDistance(uid, Distance.Unknown, pinpointer);
             return;
index e12cb24ca740e5b9bfa2cde6a329694a1358cf20..52f13474e66a49c499e37ce9d9e651cd6df013d6 100644 (file)
@@ -160,7 +160,7 @@ namespace Content.Server.Pointing.EntitySystems
             var mapCoordsPointed = _transform.ToMapCoordinates(coordsPointed);
             _rotateToFaceSystem.TryFaceCoordinates(player, mapCoordsPointed.Position);
 
-            var arrow = EntityManager.SpawnEntity("PointingArrow", coordsPointed);
+            var arrow = Spawn("PointingArrow", coordsPointed);
 
             if (TryComp<PointingArrowComponent>(arrow, out var pointing))
             {
@@ -181,7 +181,7 @@ namespace Content.Server.Pointing.EntitySystems
             var layer = (int) VisibilityFlags.Normal;
             if (TryComp(player, out VisibilityComponent? playerVisibility))
             {
-                var arrowVisibility = EntityManager.EnsureComponent<VisibilityComponent>(arrow);
+                var arrowVisibility = EnsureComp<VisibilityComponent>(arrow);
                 layer = playerVisibility.Layer;
                 _visibilitySystem.SetLayer((arrow, arrowVisibility), (ushort) layer);
             }
index 1edcec667765be74901c0056e64740d121e42deb..cc22611627cf6a3e0a67874f3f67b38403569641 100644 (file)
@@ -62,7 +62,7 @@ namespace Content.Server.Pointing.EntitySystems
 
                 if (component.Chasing is not {Valid: true} chasing || Deleted(chasing))
                 {
-                    EntityManager.QueueDeleteEntity(uid);
+                    QueueDel(uid);
                     continue;
                 }
 
@@ -99,7 +99,7 @@ namespace Content.Server.Pointing.EntitySystems
 
 
                 _explosion.QueueExplosion(uid, ExplosionSystem.DefaultExplosionPrototypeId, 50, 3, 10);
-                EntityManager.QueueDeleteEntity(uid);
+                QueueDel(uid);
             }
         }
     }
index 5d9105a3fc71a67e9ce0920da6aac621439bd273..55d517cf7d3b73994567e839ee7e88b27db63aa6 100644 (file)
@@ -48,7 +48,7 @@ public sealed partial class CableSystem
         if (TryComp<StackComponent>(placer, out var stack) && !_stack.Use(placer, 1, stack))
             return;
 
-        var newCable = EntityManager.SpawnEntity(component.CablePrototypeId, _map.GridTileToLocal(gridUid, grid, snapPos));
+        var newCable = Spawn(component.CablePrototypeId, _map.GridTileToLocal(gridUid, grid, snapPos));
         _adminLogger.Add(LogType.Construction, LogImpact.Low,
             $"{ToPrettyString(args.User):player} placed {ToPrettyString(newCable):cable} at {Transform(newCable).Coordinates}");
         args.Handled = true;
index 89f32166aead4276aa6b178e799e11200b353cd2..fd6ff70f77510e60eeaaa3a83c7f012eac29def4 100644 (file)
@@ -174,7 +174,7 @@ namespace Content.Server.Power.EntitySystems
 
         private void OnReceiverStarted(Entity<ExtensionCableReceiverComponent> receiver, ref ComponentStartup args)
         {
-            if (EntityManager.TryGetComponent(receiver.Owner, out PhysicsComponent? physicsComponent))
+            if (TryComp(receiver.Owner, out PhysicsComponent? physicsComponent))
             {
                 receiver.Comp.Connectable = physicsComponent.BodyType == BodyType.Static;
             }
index 7b41af66b983ab851bcd688c76a8bdac245e8aa9..be79d64fc9ace0b2a355d5860d0f10d2bb365f56 100644 (file)
@@ -80,7 +80,7 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
 
     private void OnPowerMonitoringConsoleMessage(EntityUid uid, PowerMonitoringConsoleComponent component, PowerMonitoringConsoleMessage args)
     {
-        var focus = EntityManager.GetEntity(args.FocusDevice);
+        var focus = GetEntity(args.FocusDevice);
         var group = args.FocusGroup;
 
         // Update this if the focus device has changed
@@ -207,17 +207,17 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
 
             if (!args.Anchored)
             {
-                entConsole.PowerMonitoringDeviceMetaData.Remove(EntityManager.GetNetEntity(uid));
+                entConsole.PowerMonitoringDeviceMetaData.Remove(GetNetEntity(uid));
                 Dirty(ent, entConsole);
 
                 continue;
             }
 
             var name = MetaData(uid).EntityName;
-            var coords = EntityManager.GetNetCoordinates(xform.Coordinates);
+            var coords = GetNetCoordinates(xform.Coordinates);
 
             var metaData = new PowerMonitoringDeviceMetaData(name, coords, component.Group, component.SpritePath, component.SpriteState);
-            entConsole.PowerMonitoringDeviceMetaData.TryAdd(EntityManager.GetNetEntity(uid), metaData);
+            entConsole.PowerMonitoringDeviceMetaData.TryAdd(GetNetEntity(uid), metaData);
 
             Dirty(ent, entConsole);
         }
@@ -364,7 +364,7 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
                 continue;
 
             // Generate a new console entry with which to populate the UI
-            var entry = new PowerMonitoringConsoleEntry(EntityManager.GetNetEntity(ent), device.Group, powerStats.PowerValue, powerStats.BatteryLevel);
+            var entry = new PowerMonitoringConsoleEntry(GetNetEntity(ent), device.Group, powerStats.PowerValue, powerStats.BatteryLevel);
             allEntries.Add(entry);
         }
 
@@ -548,7 +548,7 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
                     continue;
                 }
 
-                indexedSources.Add(ent, new PowerMonitoringConsoleEntry(EntityManager.GetNetEntity(ent), entDevice.Group, powerSupplier.CurrentSupply, GetBatteryLevel(ent)));
+                indexedSources.Add(ent, new PowerMonitoringConsoleEntry(GetNetEntity(ent), entDevice.Group, powerSupplier.CurrentSupply, GetBatteryLevel(ent)));
             }
         }
 
@@ -578,7 +578,7 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
                     continue;
                 }
 
-                indexedSources.Add(ent, new PowerMonitoringConsoleEntry(EntityManager.GetNetEntity(ent), entDevice.Group, entBattery.CurrentSupply, GetBatteryLevel(ent)));
+                indexedSources.Add(ent, new PowerMonitoringConsoleEntry(GetNetEntity(ent), entDevice.Group, entBattery.CurrentSupply, GetBatteryLevel(ent)));
             }
         }
 
@@ -662,7 +662,7 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
                     continue;
                 }
 
-                indexedLoads.Add(ent, new PowerMonitoringConsoleEntry(EntityManager.GetNetEntity(ent), entDevice.Group, powerConsumer.ReceivedPower, GetBatteryLevel(ent)));
+                indexedLoads.Add(ent, new PowerMonitoringConsoleEntry(GetNetEntity(ent), entDevice.Group, powerConsumer.ReceivedPower, GetBatteryLevel(ent)));
             }
         }
 
@@ -692,7 +692,7 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
                     continue;
                 }
 
-                indexedLoads.Add(ent, new PowerMonitoringConsoleEntry(EntityManager.GetNetEntity(ent), entDevice.Group, battery.CurrentReceiving, GetBatteryLevel(ent)));
+                indexedLoads.Add(ent, new PowerMonitoringConsoleEntry(GetNetEntity(ent), entDevice.Group, battery.CurrentReceiving, GetBatteryLevel(ent)));
             }
         }
 
@@ -831,7 +831,7 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
 
     private void UpdateCollectionChildMetaData(EntityUid child, EntityUid master)
     {
-        var netEntity = EntityManager.GetNetEntity(child);
+        var netEntity = GetNetEntity(child);
         var xform = Transform(child);
 
         var query = AllEntityQuery<PowerMonitoringConsoleComponent, TransformComponent>();
@@ -843,7 +843,7 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
             if (!entConsole.PowerMonitoringDeviceMetaData.TryGetValue(netEntity, out var metaData))
                 continue;
 
-            metaData.CollectionMaster = EntityManager.GetNetEntity(master);
+            metaData.CollectionMaster = GetNetEntity(master);
             entConsole.PowerMonitoringDeviceMetaData[netEntity] = metaData;
 
             Dirty(ent, entConsole);
@@ -852,7 +852,7 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
 
     private void UpdateCollectionMasterMetaData(EntityUid master, int childCount)
     {
-        var netEntity = EntityManager.GetNetEntity(master);
+        var netEntity = GetNetEntity(master);
         var xform = Transform(master);
 
         var query = AllEntityQuery<PowerMonitoringConsoleComponent, TransformComponent>();
@@ -960,9 +960,9 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
             if (grid != entXform.GridUid)
                 continue;
 
-            var netEntity = EntityManager.GetNetEntity(ent);
+            var netEntity = GetNetEntity(ent);
             var name = MetaData(ent).EntityName;
-            var netCoords = EntityManager.GetNetCoordinates(entXform.Coordinates);
+            var netCoords = GetNetCoordinates(entXform.Coordinates);
 
             var metaData = new PowerMonitoringDeviceMetaData(name, netCoords, entDevice.Group, entDevice.SpritePath, entDevice.SpriteState);
 
@@ -970,7 +970,7 @@ internal sealed partial class PowerMonitoringConsoleSystem : SharedPowerMonitori
             {
                 if (!entDevice.IsCollectionMaster)
                 {
-                    metaData.CollectionMaster = EntityManager.GetNetEntity(entDevice.CollectionMaster);
+                    metaData.CollectionMaster = GetNetEntity(entDevice.CollectionMaster);
                 }
 
                 else if (entDevice.ChildDevices.Count > 0)
index b8bdcd91f167392bed6a16de8ea2f4cd22093b5d..ef08240c5cacb5603ca49c54a1086ef2f46728b2 100644 (file)
@@ -111,7 +111,7 @@ namespace Content.Server.PowerSink
             foreach (var (entity, component) in toRemove)
             {
                 _explosionSystem.QueueExplosion(entity, "PowerSink", 2000f, 4f, 20f, canCreateVacuum: true);
-                EntityManager.RemoveComponent(entity, component);
+                RemComp(entity, component);
             }
         }
 
index 59fd9a5d6931b688298d3c1050f001b43a999941..4235fa2a1cbe3a35eba9f0b6f483c95064b60be7 100644 (file)
@@ -35,7 +35,7 @@ public sealed class PrayerSystem : EntitySystem
     private void AddPrayVerb(EntityUid uid, PrayableComponent comp, GetVerbsEvent<ActivationVerb> args)
     {
         // if it doesn't have an actor and we can't reach it then don't add the verb
-        if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
+        if (!TryComp(args.User, out ActorComponent? actor))
             return;
 
         // this is to prevent ghosts from using it
@@ -48,7 +48,7 @@ public sealed class PrayerSystem : EntitySystem
             Icon = comp.VerbImage,
             Act = () =>
             {
-                if (comp.BibleUserOnly && !EntityManager.TryGetComponent<BibleUserComponent>(args.User, out var bibleUser))
+                if (comp.BibleUserOnly && !TryComp<BibleUserComponent>(args.User, out var bibleUser))
                 {
                     _popupSystem.PopupEntity(Loc.GetString("prayer-popup-notify-pray-locked"), uid, actor.PlayerSession, PopupType.Large);
                     return;
index 09e881686e479897c3df8e30de6f0491666641db..01cc6d3676af51916e06033251018a9666824c23 100644 (file)
@@ -47,7 +47,7 @@ public sealed partial class DungeonSystem
         if (!TryComp<MapGridComponent>(dungeonUid, out var dungeonGrid))
         {
             dungeonUid = EntityManager.CreateEntityUninitialized(null, new EntityCoordinates(dungeonUid, position));
-            dungeonGrid = EntityManager.AddComponent<MapGridComponent>(dungeonUid);
+            dungeonGrid = AddComp<MapGridComponent>(dungeonUid);
             EntityManager.InitializeAndStartEntity(dungeonUid, mapId);
             // If we created a grid (e.g. space dungen) then offset it so we don't double-apply positions
             position = Vector2i.Zero;
index 64bb678321b3d46282e0178583bc46804dd20bae..4c054a456129d5ce35a5a5845a90da482383cab9 100644 (file)
@@ -57,7 +57,7 @@ public sealed class ProjectileSystem : SharedProjectileSystem
         var modifiedDamage = _damageableSystem.TryChangeDamage(target, ev.Damage, component.IgnoreResistances, damageable: damageableComponent, origin: component.Shooter);
         var deleted = Deleted(target);
 
-        if (modifiedDamage is not null && EntityManager.EntityExists(component.Shooter))
+        if (modifiedDamage is not null && Exists(component.Shooter))
         {
             if (modifiedDamage.AnyPositive() && !deleted)
             {
index ffcf12b9d8e26bd6eec749c3af51ff9a068da19a..796c1e1fcefc8a4a1142e6528aee4fff2ddc1bfc 100644 (file)
@@ -35,7 +35,7 @@ public partial class RadiationSystem
         stopwatch.Start();
 
         _sources.Clear();
-        _sources.EnsureCapacity(EntityManager.Count<RadiationSourceComponent>());
+        _sources.EnsureCapacity(Count<RadiationSourceComponent>());
 
         var sources = EntityQueryEnumerator<RadiationSourceComponent, TransformComponent>();
         var destinations = EntityQueryEnumerator<RadiationReceiverComponent, TransformComponent>();
index 68dcfd6743d4e8d74f70fc7fe53d2bd5d3f6fef6..c05a13c387ee1004c533d5bc0408383812d0958b 100644 (file)
@@ -26,7 +26,7 @@ namespace Content.Server.Repairable
             if (args.Cancelled)
                 return;
 
-            if (!EntityManager.TryGetComponent(uid, out DamageableComponent? damageable) || damageable.TotalDamage == 0)
+            if (!TryComp(uid, out DamageableComponent? damageable) || damageable.TotalDamage == 0)
                 return;
 
             if (component.Damage != null)
index 4d65c19f6e28dcabb27a07063ed2748661c78582..2e30367a1c3a37d876765480d63e10d170d989b2 100644 (file)
@@ -30,7 +30,7 @@ namespace Content.Server.Research.Disk
 
             _research.ModifyServerPoints(args.Target.Value, component.Points, server);
             _popupSystem.PopupEntity(Loc.GetString("research-disk-inserted", ("points", component.Points)), args.Target.Value, args.User);
-            EntityManager.QueueDeleteEntity(uid);
+            QueueDel(uid);
             args.Handled = true;
         }
 
index 32f8c91403341379d120c9607c779e3e4f10a02f..5190b0e92e26d0e90bc5a0fadb3894e647de574f 100644 (file)
@@ -43,7 +43,7 @@ namespace Content.Server.Rotatable
                 return;
 
             // Check if the object is anchored.
-            if (EntityManager.TryGetComponent(uid, out PhysicsComponent? physics) && physics.BodyType == BodyType.Static)
+            if (TryComp(uid, out PhysicsComponent? physics) && physics.BodyType == BodyType.Static)
                 return;
 
             Verb verb = new()
@@ -68,14 +68,14 @@ namespace Content.Server.Rotatable
 
             // Check if the object is anchored, and whether we are still allowed to rotate it.
             if (!component.RotateWhileAnchored &&
-                EntityManager.TryGetComponent(uid, out PhysicsComponent? physics) &&
+                TryComp(uid, out PhysicsComponent? physics) &&
                 physics.BodyType == BodyType.Static)
                 return;
 
             Verb resetRotation = new()
             {
                 DoContactInteraction = true,
-                Act = () => EntityManager.GetComponent<TransformComponent>(uid).LocalRotation = Angle.Zero,
+                Act = () => Comp<TransformComponent>(uid).LocalRotation = Angle.Zero,
                 Category = VerbCategory.Rotate,
                 Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/refresh.svg.192dpi.png")),
                 Text = "Reset",
@@ -87,7 +87,7 @@ namespace Content.Server.Rotatable
             // rotate clockwise
             Verb rotateCW = new()
             {
-                Act = () => EntityManager.GetComponent<TransformComponent>(uid).LocalRotation -= component.Increment,
+                Act = () => Comp<TransformComponent>(uid).LocalRotation -= component.Increment,
                 Category = VerbCategory.Rotate,
                 Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/rotate_cw.svg.192dpi.png")),
                 Priority = -1,
@@ -98,7 +98,7 @@ namespace Content.Server.Rotatable
             // rotate counter-clockwise
             Verb rotateCCW = new()
             {
-                Act = () => EntityManager.GetComponent<TransformComponent>(uid).LocalRotation += component.Increment,
+                Act = () => Comp<TransformComponent>(uid).LocalRotation += component.Increment,
                 Category = VerbCategory.Rotate,
                 Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/rotate_ccw.svg.192dpi.png")),
                 Priority = 0,
@@ -112,12 +112,12 @@ namespace Content.Server.Rotatable
         /// </summary>
         public void Flip(EntityUid uid, FlippableComponent component)
         {
-            var oldTransform = EntityManager.GetComponent<TransformComponent>(uid);
-            var entity = EntityManager.SpawnEntity(component.MirrorEntity, oldTransform.Coordinates);
-            var newTransform = EntityManager.GetComponent<TransformComponent>(entity);
+            var oldTransform = Comp<TransformComponent>(uid);
+            var entity = Spawn(component.MirrorEntity, oldTransform.Coordinates);
+            var newTransform = Comp<TransformComponent>(entity);
             newTransform.LocalRotation = oldTransform.LocalRotation;
             _transform.Unanchor(entity, newTransform);
-            EntityManager.DeleteEntity(uid);
+            Del(uid);
         }
 
         public bool HandleRotateObjectClockwise(ICommonSession? playerSession, EntityCoordinates coordinates, EntityUid entity)
@@ -134,7 +134,7 @@ namespace Content.Server.Rotatable
                 return false;
 
             // Check if the object is anchored, and whether we are still allowed to rotate it.
-            if (!rotatableComp.RotateWhileAnchored && EntityManager.TryGetComponent(entity, out PhysicsComponent? physics) &&
+            if (!rotatableComp.RotateWhileAnchored && TryComp(entity, out PhysicsComponent? physics) &&
                 physics.BodyType == BodyType.Static)
             {
                 _popup.PopupEntity(Loc.GetString("rotatable-component-try-rotate-stuck"), entity, player);
@@ -159,7 +159,7 @@ namespace Content.Server.Rotatable
                 return false;
 
             // Check if the object is anchored, and whether we are still allowed to rotate it.
-            if (!rotatableComp.RotateWhileAnchored && EntityManager.TryGetComponent(entity, out PhysicsComponent? physics) &&
+            if (!rotatableComp.RotateWhileAnchored && TryComp(entity, out PhysicsComponent? physics) &&
                 physics.BodyType == BodyType.Static)
             {
                 _popup.PopupEntity(Loc.GetString("rotatable-component-try-rotate-stuck"), entity, player);
@@ -184,7 +184,7 @@ namespace Content.Server.Rotatable
                 return false;
 
             // Check if the object is anchored.
-            if (EntityManager.TryGetComponent(entity, out PhysicsComponent? physics) && physics.BodyType == BodyType.Static)
+            if (TryComp(entity, out PhysicsComponent? physics) && physics.BodyType == BodyType.Static)
             {
                 _popup.PopupEntity(Loc.GetString("flippable-component-try-flip-is-stuck"), entity, player);
                 return false;
index fcdd6c0c1ae35d6e48ba052d3caf89cf34f7acdb..318affda2e33e416f3719e31951d88af389db384 100644 (file)
@@ -94,7 +94,7 @@ namespace Content.Server.Shuttles.Systems
         private void OnShutdown(EntityUid uid, DockingComponent component, ComponentShutdown args)
         {
             if (component.DockedWith == null ||
-                EntityManager.GetComponent<MetaDataComponent>(uid).EntityLifeStage > EntityLifeStage.MapInitialized)
+                Comp<MetaDataComponent>(uid).EntityLifeStage > EntityLifeStage.MapInitialized)
             {
                 return;
             }
@@ -137,8 +137,8 @@ namespace Content.Server.Shuttles.Systems
             dockA.DockJointId = null;
 
             // If these grids are ever null then need to look at fixing ordering for unanchored events elsewhere.
-            var gridAUid = EntityManager.GetComponent<TransformComponent>(dockAUid).GridUid;
-            var gridBUid = EntityManager.GetComponent<TransformComponent>(dockBUid.Value).GridUid;
+            var gridAUid = Comp<TransformComponent>(dockAUid).GridUid;
+            var gridBUid = Comp<TransformComponent>(dockBUid.Value).GridUid;
 
             var msg = new UndockEvent
             {
@@ -159,7 +159,7 @@ namespace Content.Server.Shuttles.Systems
             var component = entity.Comp;
 
             // Use startup so transform already initialized
-            if (!EntityManager.GetComponent<TransformComponent>(uid).Anchored)
+            if (!Comp<TransformComponent>(uid).Anchored)
                 return;
 
             // This little gem is for docking deserialization
@@ -169,7 +169,7 @@ namespace Content.Server.Shuttles.Systems
                 if (MetaData(component.DockedWith.Value).EntityLifeStage < EntityLifeStage.Initialized)
                     return;
 
-                var otherDock = EntityManager.GetComponent<DockingComponent>(component.DockedWith.Value);
+                var otherDock = Comp<DockingComponent>(component.DockedWith.Value);
                 DebugTools.Assert(otherDock.DockedWith != null);
 
                 Dock((uid, component), (component.DockedWith.Value, otherDock));
@@ -220,8 +220,8 @@ namespace Content.Server.Shuttles.Systems
             // https://gamedev.stackexchange.com/questions/98772/b2distancejoint-with-frequency-equal-to-0-vs-b2weldjoint
 
             // We could also potentially use a prismatic joint? Depending if we want clamps that can extend or whatever
-            var dockAXform = EntityManager.GetComponent<TransformComponent>(dockAUid);
-            var dockBXform = EntityManager.GetComponent<TransformComponent>(dockBUid);
+            var dockAXform = Comp<TransformComponent>(dockAUid);
+            var dockBXform = Comp<TransformComponent>(dockBUid);
 
             DebugTools.Assert(dockAXform.GridUid != null);
             DebugTools.Assert(dockBXform.GridUid != null);
@@ -235,8 +235,8 @@ namespace Content.Server.Shuttles.Systems
                 SharedJointSystem.LinearStiffness(
                     2f,
                     0.7f,
-                    EntityManager.GetComponent<PhysicsComponent>(gridA).Mass,
-                    EntityManager.GetComponent<PhysicsComponent>(gridB).Mass,
+                    Comp<PhysicsComponent>(gridA).Mass,
+                    Comp<PhysicsComponent>(gridB).Mass,
                     out var stiffness,
                     out var damping);
 
@@ -255,8 +255,8 @@ namespace Content.Server.Shuttles.Systems
                     joint = _jointSystem.GetOrCreateWeldJoint(gridA, gridB, DockingJoint + dockAUid);
                 }
 
-                var gridAXform = EntityManager.GetComponent<TransformComponent>(gridA);
-                var gridBXform = EntityManager.GetComponent<TransformComponent>(gridB);
+                var gridAXform = Comp<TransformComponent>(gridA);
+                var gridBXform = Comp<TransformComponent>(gridB);
 
                 var anchorA = dockAXform.LocalPosition + dockAXform.LocalRotation.ToWorldVec() / 2f;
                 var anchorB = dockBXform.LocalPosition + dockBXform.LocalRotation.ToWorldVec() / 2f;
index 478b002e58538628b1c4db5fe4907d0f730c5add..049e14913548f3b39c948e1f0e84b1694c54eb73 100644 (file)
@@ -320,7 +320,7 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
 
     public void AddPilot(EntityUid uid, EntityUid entity, ShuttleConsoleComponent component)
     {
-        if (!EntityManager.TryGetComponent(entity, out PilotComponent? pilotComponent)
+        if (!TryComp(entity, out PilotComponent? pilotComponent)
         || component.SubscribedPilots.Contains(entity))
         {
             return;
@@ -334,7 +334,7 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
 
         pilotComponent.Console = uid;
         ActionBlockerSystem.UpdateCanMove(entity);
-        pilotComponent.Position = EntityManager.GetComponent<TransformComponent>(entity).Coordinates;
+        pilotComponent.Position = Comp<TransformComponent>(entity).Coordinates;
         Dirty(entity, pilotComponent);
     }
 
@@ -357,12 +357,12 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
         _popup.PopupEntity(Loc.GetString("shuttle-pilot-end"), pilotUid, pilotUid);
 
         if (pilotComponent.LifeStage < ComponentLifeStage.Stopping)
-            EntityManager.RemoveComponent<PilotComponent>(pilotUid);
+            RemComp<PilotComponent>(pilotUid);
     }
 
     public void RemovePilot(EntityUid entity)
     {
-        if (!EntityManager.TryGetComponent(entity, out PilotComponent? pilotComponent))
+        if (!TryComp(entity, out PilotComponent? pilotComponent))
             return;
 
         RemovePilot(entity, pilotComponent);
index f271be108f15d245af79965d6411f1360d9b96a9..cea7fbfc091f1ab136a43aac86f28d959117408b 100644 (file)
@@ -109,12 +109,12 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
 
     private void OnShuttleStartup(EntityUid uid, ShuttleComponent component, ComponentStartup args)
     {
-        if (!EntityManager.HasComponent<MapGridComponent>(uid))
+        if (!HasComp<MapGridComponent>(uid))
         {
             return;
         }
 
-        if (!EntityManager.TryGetComponent(uid, out PhysicsComponent? physicsComponent))
+        if (!TryComp(uid, out PhysicsComponent? physicsComponent))
         {
             return;
         }
@@ -129,7 +129,7 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
 
     public void Toggle(EntityUid uid, ShuttleComponent component)
     {
-        if (!EntityManager.TryGetComponent(uid, out PhysicsComponent? physicsComponent))
+        if (!TryComp(uid, out PhysicsComponent? physicsComponent))
             return;
 
         component.Enabled = !component.Enabled;
@@ -167,7 +167,7 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
     private void OnShuttleShutdown(EntityUid uid, ShuttleComponent component, ComponentShutdown args)
     {
         // None of the below is necessary for any cleanup if we're just deleting.
-        if (EntityManager.GetComponent<MetaDataComponent>(uid).EntityLifeStage >= EntityLifeStage.Terminating)
+        if (Comp<MetaDataComponent>(uid).EntityLifeStage >= EntityLifeStage.Terminating)
             return;
 
         Disable(uid);
index e7f93043cbcebf195d9ee815c24d2e08129aecec..f7f0a8b25112fbfa59351bda65f986dbb6433c17 100644 (file)
@@ -68,7 +68,7 @@ public sealed class ThrusterSystem : EntitySystem
             args.PushMarkup(enabled);
 
             if (component.Type == ThrusterType.Linear &&
-                EntityManager.TryGetComponent(uid, out TransformComponent? xform) &&
+                TryComp(uid, out TransformComponent? xform) &&
                 xform.Anchored)
             {
                 var nozzleLocalization = ContentLocalizationManager.FormatDirection(xform.LocalRotation.Opposite().ToWorldVec().GetDir()).ToLower();
@@ -163,8 +163,8 @@ public sealed class ThrusterSystem : EntitySystem
         // TODO: Don't make them rotatable and make it require anchoring.
 
         if (!component.Enabled ||
-            !EntityManager.TryGetComponent(uid, out TransformComponent? xform) ||
-            !EntityManager.TryGetComponent(xform.GridUid, out ShuttleComponent? shuttleComponent))
+            !TryComp(uid, out TransformComponent? xform) ||
+            !TryComp(xform.GridUid, out ShuttleComponent? shuttleComponent))
         {
             return;
         }
@@ -285,7 +285,7 @@ public sealed class ThrusterSystem : EntitySystem
 
         component.IsOn = true;
 
-        if (!EntityManager.TryGetComponent(xform.GridUid, out ShuttleComponent? shuttleComponent))
+        if (!TryComp(xform.GridUid, out ShuttleComponent? shuttleComponent))
             return;
 
         // Logger.DebugS("thruster", $"Enabled thruster {uid}");
@@ -300,7 +300,7 @@ public sealed class ThrusterSystem : EntitySystem
                 shuttleComponent.LinearThrusters[direction].Add(uid);
 
                 // Don't just add / remove the fixture whenever the thruster fires because perf
-                if (EntityManager.TryGetComponent(uid, out PhysicsComponent? physicsComponent) &&
+                if (TryComp(uid, out PhysicsComponent? physicsComponent) &&
                     component.BurnPoly.Count > 0)
                 {
                     var shape = new PolygonShape();
@@ -318,7 +318,7 @@ public sealed class ThrusterSystem : EntitySystem
                 throw new ArgumentOutOfRangeException();
         }
 
-        if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
+        if (TryComp(uid, out AppearanceComponent? appearance))
         {
             _appearance.SetData(uid, ThrusterVisualState.State, true, appearance);
         }
@@ -382,7 +382,7 @@ public sealed class ThrusterSystem : EntitySystem
 
         component.IsOn = false;
 
-        if (!EntityManager.TryGetComponent(gridId, out ShuttleComponent? shuttleComponent))
+        if (!TryComp(gridId, out ShuttleComponent? shuttleComponent))
             return;
 
         // Logger.DebugS("thruster", $"Disabled thruster {uid}");
@@ -406,7 +406,7 @@ public sealed class ThrusterSystem : EntitySystem
                 throw new ArgumentOutOfRangeException();
         }
 
-        if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
+        if (TryComp(uid, out AppearanceComponent? appearance))
         {
             _appearance.SetData(uid, ThrusterVisualState.State, false, appearance);
         }
@@ -418,7 +418,7 @@ public sealed class ThrusterSystem : EntitySystem
 
         _ambient.SetAmbience(uid, false);
 
-        if (EntityManager.TryGetComponent(uid, out PhysicsComponent? physicsComponent))
+        if (TryComp(uid, out PhysicsComponent? physicsComponent))
         {
             _fixtureSystem.DestroyFixture(uid, BurnFixture, body: physicsComponent);
         }
index baec24bf73b22393e3cb0f55a745e2ac5c8bc1e4..9b272a00f9e5e143cf04053af6722ef84d388dab 100644 (file)
@@ -37,7 +37,7 @@ public sealed class StationAiSystem : SharedStationAiSystem
         var sourcePos = _xforms.GetWorldPosition(sourceXform, xformQuery);
 
         // This function ensures that chat popups appear on camera views that have connected microphones.
-        var query = EntityManager.EntityQueryEnumerator<StationAiCoreComponent, TransformComponent>();
+        var query = EntityQueryEnumerator<StationAiCoreComponent, TransformComponent>();
         while (query.MoveNext(out var ent, out var entStationAiCore, out var entXform))
         {
             var stationAiCore = new Entity<StationAiCoreComponent?>(ent, entStationAiCore);
index 7a15ba3413e7875fec8abe0c6fc8a7dff4b8af3b..9c69422797eefb902d535d81a69342ab5da304ea 100644 (file)
@@ -137,7 +137,7 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
             _adminLogger.Add(LogType.EntityDelete, LogImpact.High, $"{ToPrettyString(morsel):player} entered the event horizon of {ToPrettyString(hungry)} and was deleted");
         }
 
-        EntityManager.QueueDeleteEntity(morsel);
+        QueueDel(morsel);
         var evSelf = new EntityConsumedByEventHorizonEvent(morsel, hungry, eventHorizon, outerContainer);
         var evEaten = new EventHorizonConsumedEntityEvent(morsel, hungry, eventHorizon, outerContainer);
         RaiseLocalEvent(hungry, ref evSelf);
@@ -460,14 +460,14 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
     private void OnEventHorizonContained(EventHorizonContainedEvent args)
     {
         var uid = args.Entity;
-        if (!EntityManager.EntityExists(uid))
+        if (!Exists(uid))
             return;
         var comp = args.EventHorizon;
         if (comp.BeingConsumedByAnotherEventHorizon)
             return;
 
         var containerEntity = args.Args.Container.Owner;
-        if (!EntityManager.EntityExists(containerEntity))
+        if (!Exists(containerEntity))
             return;
         if (AttemptConsumeEntity(uid, containerEntity, comp))
             return; // If we consume the entity we also consume everything in the containers it has.
index 63ff5f83007b8a78bac7d670c93fc6d0c1a2fa3c..6cbe46c7590ad886681c9958918ff8aca735b1f2 100644 (file)
@@ -48,7 +48,7 @@ public sealed class RadiationCollectorSystem : EntitySystem
         if (!_containerSystem.TryGetContainer(uid, GasTankContainer, out var container) || container.ContainedEntities.Count == 0)
             return false;
 
-        if (!EntityManager.TryGetComponent(container.ContainedEntities.First(), out gasTankComponent))
+        if (!TryComp(container.ContainedEntities.First(), out gasTankComponent))
             return false;
 
         return true;
index 95722449b87799fe047412ce15bad6572d40a08e..8e33410561c2c2270718602ba487267a6e16f0f4 100644 (file)
@@ -53,7 +53,7 @@ public sealed class SingularityGeneratorSystem : SharedSingularityGeneratorSyste
             return;
 
         SetPower(uid, 0, comp);
-        EntityManager.SpawnEntity(comp.SpawnPrototype, Transform(uid).Coordinates);
+        Spawn(comp.SpawnPrototype, Transform(uid).Coordinates);
     }
 
     #region Getters/Setters
@@ -109,12 +109,12 @@ public sealed class SingularityGeneratorSystem : SharedSingularityGeneratorSyste
     /// <param name="args">The state of the beginning of the collision.</param>
     private void HandleParticleCollide(EntityUid uid, ParticleProjectileComponent component, ref StartCollideEvent args)
     {
-        if (!EntityManager.TryGetComponent<SingularityGeneratorComponent>(args.OtherEntity, out var generatorComp))
+        if (!TryComp<SingularityGeneratorComponent>(args.OtherEntity, out var generatorComp))
             return;
 
         if (_timing.CurTime < _metadata.GetPauseTime(uid) + generatorComp.NextFailsafe && !generatorComp.FailsafeDisabled)
         {
-            EntityManager.QueueDeleteEntity(uid);
+            QueueDel(uid);
             return;
         }
 
@@ -152,7 +152,7 @@ public sealed class SingularityGeneratorSystem : SharedSingularityGeneratorSyste
             );
         }
 
-        EntityManager.QueueDeleteEntity(uid);
+        QueueDel(uid);
     }
     #endregion Event Handlers
 
index f28502fc75eccf42773f8b909fc983222db5c895..f86faf9ee4871683edddf6182dc44baf6fc6f373 100644 (file)
@@ -240,7 +240,7 @@ public sealed class SingularitySystem : SharedSingularitySystem
     private void OnConsumed(EntityUid uid, SingularityComponent comp, ref EventHorizonConsumedEntityEvent args)
     {
         // Should be slightly more efficient than checking literally everything we consume for a singularity component and doing the reverse.
-        if (EntityManager.TryGetComponent<SingularityComponent>(args.EventHorizonUid, out var singulo))
+        if (TryComp<SingularityComponent>(args.EventHorizonUid, out var singulo))
         {
             AdjustEnergy(args.EventHorizonUid, comp.Energy, singularity: singulo);
             SetEnergy(uid, 0.0f, comp);
@@ -255,7 +255,7 @@ public sealed class SingularitySystem : SharedSingularitySystem
     /// <param name="args">The event arguments.</param>
     public void OnConsumed(EntityUid uid, SinguloFoodComponent comp, ref EventHorizonConsumedEntityEvent args)
     {
-        if (EntityManager.TryGetComponent<SingularityComponent>(args.EventHorizonUid, out var singulo))
+        if (TryComp<SingularityComponent>(args.EventHorizonUid, out var singulo))
         {
             // Calculate the percentage change (positive or negative)
             var percentageChange = singulo.Energy * (comp.EnergyFactor - 1f);
index 4f1cdb0eb0ee7b8dd71d77ba4e07fd630671d36a..d6c048d13f4ef3f3bec4c6490056e5e1cc1460c2 100644 (file)
@@ -122,7 +122,7 @@ namespace Content.Server.Solar.EntitySystems
         private void UpdatePanelCoverage(Entity<SolarPanelComponent> panel)
         {
             var entity = panel.Owner;
-            var xform = EntityManager.GetComponent<TransformComponent>(entity);
+            var xform = Comp<TransformComponent>(entity);
 
             // So apparently, and yes, I *did* only find this out later,
             // this is just a really fancy way of saying "Lambert's law of cosines".
index 7331894bcf8b883b447276cb670eb673f59b44e9..96deb70b47bcf1269e66e432d9dec29ce1b50f9f 100644 (file)
@@ -89,14 +89,14 @@ namespace Content.Server.Spawners.EntitySystems
             }
 
             if (!Deleted(uid))
-                EntityManager.SpawnEntity(_robustRandom.Pick(component.Prototypes), Transform(uid).Coordinates);
+                Spawn(_robustRandom.Pick(component.Prototypes), Transform(uid).Coordinates);
         }
 
         private void Spawn(EntityUid uid, RandomSpawnerComponent component)
         {
             if (component.RarePrototypes.Count > 0 && (component.RareChance == 1.0f || _robustRandom.Prob(component.RareChance)))
             {
-                EntityManager.SpawnEntity(_robustRandom.Pick(component.RarePrototypes), Transform(uid).Coordinates);
+                Spawn(_robustRandom.Pick(component.RarePrototypes), Transform(uid).Coordinates);
                 return;
             }
 
@@ -118,7 +118,7 @@ namespace Content.Server.Spawners.EntitySystems
 
             var coordinates = Transform(uid).Coordinates.Offset(new Vector2(xOffset, yOffset));
 
-            EntityManager.SpawnEntity(_robustRandom.Pick(component.Prototypes), coordinates);
+            Spawn(_robustRandom.Pick(component.Prototypes), coordinates);
         }
 
         private void Spawn(Entity<EntityTableSpawnerComponent> ent)
index d491b957bfb3c0a7ef78cacf1243067d6e490dbc..11493b65b3ee81054cf5d6e1ef542d62c69f6274 100644 (file)
@@ -35,7 +35,7 @@ public sealed partial class NymphSystem : EntitySystem
 
         // Get the organs' position & spawn a nymph there
         var coords = Transform(uid).Coordinates;
-        var nymph = EntityManager.SpawnAtPosition(entityProto.ID, coords);
+        var nymph = SpawnAtPosition(entityProto.ID, coords);
 
         if (HasComp<ZombieComponent>(args.OldBody)) // Zombify the new nymph if old one is a zombie
             _zombie.ZombifyEntity(nymph);
index 98d35efae4b084a1be3975be6ab9d995b16c4033..261377a14a9e750d068eb494b7081e2f265f7c98 100644 (file)
@@ -39,7 +39,7 @@ public sealed class AddAccentClothingSystem : EntitySystem
 
         // try to remove accent
         var componentType = Factory.GetRegistration(component.Accent).Type;
-        EntityManager.RemoveComponent(args.Wearer, componentType);
+        RemComp(args.Wearer, componentType);
 
         component.IsActive = false;
     }
index dc176ebc2a6501a24f6717376a30e3e7c4efb4ac..92e6609fd746f4c1c85da49dd317345985e8b5fd 100644 (file)
@@ -36,7 +36,7 @@ public sealed class KudzuSystem : EntitySystem
                 component.GrowthLevel = 3;
 
             component.GrowthLevel = Math.Max(1, component.GrowthLevel - growthDamage);
-            if (EntityManager.TryGetComponent<AppearanceComponent>(uid, out var appearance))
+            if (TryComp<AppearanceComponent>(uid, out var appearance))
             {
                 _appearance.SetData(uid, KudzuVisuals.GrowthLevel, component.GrowthLevel, appearance);
             }
@@ -79,7 +79,7 @@ public sealed class KudzuSystem : EntitySystem
 
     private void SetupKudzu(EntityUid uid, KudzuComponent component, ComponentStartup args)
     {
-        if (!EntityManager.TryGetComponent<AppearanceComponent>(uid, out var appearance))
+        if (!TryComp<AppearanceComponent>(uid, out var appearance))
         {
             return;
         }
index 924146bc1f9a109ab3b6e3b31f4516fb226eff18..7b9abee5d2b8d76da8b6d097b118ff6d0b343329 100644 (file)
@@ -109,7 +109,7 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
         if (prototype?.JobEntity != null)
         {
             DebugTools.Assert(entity is null);
-            var jobEntity = EntityManager.SpawnEntity(prototype.JobEntity, coordinates);
+            var jobEntity = Spawn(prototype.JobEntity, coordinates);
             MakeSentientCommand.MakeSentient(jobEntity, EntityManager);
 
             // Make sure custom names get handled, what is gameticker control flow whoopy.
index 3b6eeebe8515e39a098e2d0fa04521c778cc7929..ad8e4b5a42cceb9a77884aabf838e624d4900ac5 100644 (file)
@@ -29,7 +29,7 @@ public sealed class VentClogRule : StationEventSystem<VentClogRuleComponent>
             .Where(x => !x.Abstract)
             .Select(x => x.ID).ToList();
 
-        foreach (var (_, transform) in EntityManager.EntityQuery<GasVentPumpComponent, TransformComponent>())
+        foreach (var (_, transform) in EntityQuery<GasVentPumpComponent, TransformComponent>())
         {
             if (CompOrNull<StationMemberComponent>(transform.GridUid)?.Station != chosenStation)
             {
index de5ab7a6cae6b631238e4b1894e0e66843ca4328..11f3fb1bdb67d5bb65732161123b377c81375b53 100644 (file)
@@ -95,7 +95,7 @@ public sealed class BluespaceLockerSystem : EntitySystem
             if (component.BehaviorProperties.TransportEntities || component.BehaviorProperties.TransportSentient)
                 foreach (var entity in target.Value.storageComponent.Contents.ContainedEntities.ToArray())
                 {
-                    if (EntityManager.HasComponent<MindContainerComponent>(entity))
+                    if (HasComp<MindContainerComponent>(entity))
                     {
                         if (!component.BehaviorProperties.TransportSentient)
                             continue;
@@ -312,7 +312,7 @@ public sealed class BluespaceLockerSystem : EntitySystem
         if (component.BehaviorProperties.TransportEntities || component.BehaviorProperties.TransportSentient)
             foreach (var entity in entityStorageComponent.Contents.ContainedEntities.ToArray())
             {
-                if (EntityManager.HasComponent<MindContainerComponent>(entity))
+                if (HasComp<MindContainerComponent>(entity))
                 {
                     if (!component.BehaviorProperties.TransportSentient)
                         continue;
index 43fcb32d1f070dcc148d355048c19d348df7c0bb..a1ac2bfdbb6d0cfa72461d553cf6cb8ff3a1c951 100644 (file)
@@ -13,7 +13,7 @@ namespace Content.Server.Storage.EntitySystems
         [Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
         protected override int? GetCount(ContainerModifiedMessage msg, ItemCounterComponent itemCounter)
         {
-            if (!EntityManager.TryGetComponent(msg.Container.Owner, out StorageComponent? component))
+            if (!TryComp(msg.Container.Owner, out StorageComponent? component))
             {
                 return null;
             }
index 548fa7bfda3de308a6438e827c8a811ed32863f6..ec02006b2703fe36f4b6f3dfdca700ff82875db9 100644 (file)
@@ -40,7 +40,7 @@ namespace Content.Server.Storage.EntitySystems
                 // Calculate the average price of the possible spawned items
                 args.Price += _pricing.GetPrice(protUid) * entry.SpawnProbability * entry.GetAmount(getAverage: true);
 
-                EntityManager.DeleteEntity(protUid);
+                Del(protUid);
             }
 
             foreach (var group in orGroups)
@@ -54,7 +54,7 @@ namespace Content.Server.Storage.EntitySystems
                                   (entry.SpawnProbability / group.CumulativeProbability) *
                                   entry.GetAmount(getAverage: true);
 
-                    EntityManager.DeleteEntity(protUid);
+                    Del(protUid);
                 }
             }
 
index f9772e48dafa8db63958c215151289110376bca1..742434ff23a9eb3b310e937f6de06a7250f3d470 100644 (file)
@@ -352,7 +352,7 @@ public sealed partial class StoreSystem
 
             _actionContainer.RemoveAction(purchase, logMissing: false);
 
-            EntityManager.DeleteEntity(purchase);
+            Del(purchase);
         }
 
         component.BoughtEntities.Clear();
index 52e3cab79c59236ffa468a7a5e0b5db0c5ccf14a..ae10957bd8e34d3ea4028b68326f5851668cd516 100644 (file)
@@ -23,7 +23,7 @@ namespace Content.Server.Stunnable
         private void TryDoCollideStun(EntityUid uid, StunOnCollideComponent component, EntityUid target)
         {
 
-            if (EntityManager.TryGetComponent<StatusEffectsComponent>(target, out var status))
+            if (TryComp<StatusEffectsComponent>(target, out var status))
             {
                 _stunSystem.TryStun(target, TimeSpan.FromSeconds(component.StunAmount), true, status);
 
index 30bbb2f0e9b6fa9304ab45fcf9d5a067d2ec99e3..4f59654bb963be16aa38ae6e242c2f5f53b962bf 100644 (file)
@@ -57,7 +57,7 @@ public sealed class SurveillanceCameraMonitorSystem : EntitySystem
             if (monitor.LastHeartbeat > _maxHeartbeatTime)
             {
                 DisconnectCamera(uid, true, monitor);
-                EntityManager.RemoveComponent<ActiveSurveillanceCameraMonitorComponent>(uid);
+                RemComp<ActiveSurveillanceCameraMonitorComponent>(uid);
             }
         }
     }
@@ -256,7 +256,7 @@ public sealed class SurveillanceCameraMonitorSystem : EntitySystem
 
         monitor.ActiveCamera = null;
         monitor.ActiveCameraAddress = string.Empty;
-        EntityManager.RemoveComponent<ActiveSurveillanceCameraMonitorComponent>(uid);
+        RemComp<ActiveSurveillanceCameraMonitorComponent>(uid);
         UpdateUserInterface(uid, monitor);
     }
 
index 837ab2df24c8d87f10c80c0098cf0c8c91b18de9..5e116d81ef6db457f046ebe12ab2b6fbf239010d 100644 (file)
@@ -52,7 +52,7 @@ namespace Content.Server.Tabletop
             TabletopMap = mapId;
             _tabletops = 0;
 
-            var mapComp = EntityManager.GetComponent<MapComponent>(mapUid);
+            var mapComp = Comp<MapComponent>(mapUid);
 
             // Lighting is always disabled in tabletop world.
             mapComp.LightingEnabled = false;
index c2bb8426fc2efa876226d870b6b8eb6f3e19c9de..2f271b4b66776905ef2da8c2e2097aa428d53134 100644 (file)
@@ -42,7 +42,7 @@ namespace Content.Server.Tabletop
         /// <param name="uid">The UID of the tabletop game entity.</param>
         public void CleanupSession(EntityUid uid)
         {
-            if (!EntityManager.TryGetComponent(uid, out TabletopGameComponent? tabletop))
+            if (!TryComp(uid, out TabletopGameComponent? tabletop))
                 return;
 
             if (tabletop.Session is not { } session)
@@ -55,7 +55,7 @@ namespace Content.Server.Tabletop
 
             foreach (var euid in session.Entities)
             {
-                EntityManager.QueueDeleteEntity(euid);
+                QueueDel(euid);
             }
 
             tabletop.Session = null;
@@ -68,7 +68,7 @@ namespace Content.Server.Tabletop
         /// <param name="uid">The UID of the tabletop game entity.</param>
         public void OpenSessionFor(ICommonSession player, EntityUid uid)
         {
-            if (!EntityManager.TryGetComponent(uid, out TabletopGameComponent? tabletop) || player.AttachedEntity is not {Valid: true} attachedEntity)
+            if (!TryComp(uid, out TabletopGameComponent? tabletop) || player.AttachedEntity is not {Valid: true} attachedEntity)
                 return;
 
             // Make sure we have a session, and add the player to it if not added already.
@@ -77,7 +77,7 @@ namespace Content.Server.Tabletop
             if (session.Players.ContainsKey(player))
                 return;
 
-            if(EntityManager.TryGetComponent(attachedEntity, out TabletopGamerComponent? gamer))
+            if(TryComp(attachedEntity, out TabletopGamerComponent? gamer))
                 CloseSessionFor(player, gamer.Tabletop, false);
 
             // Set the entity as an absolute GAMER.
@@ -100,26 +100,26 @@ namespace Content.Server.Tabletop
         /// <param name="removeGamerComponent">Whether to remove the <see cref="TabletopGamerComponent"/> from the player's attached entity.</param>
         public void CloseSessionFor(ICommonSession player, EntityUid uid, bool removeGamerComponent = true)
         {
-            if (!EntityManager.TryGetComponent(uid, out TabletopGameComponent? tabletop) || tabletop.Session is not { } session)
+            if (!TryComp(uid, out TabletopGameComponent? tabletop) || tabletop.Session is not { } session)
                 return;
 
             if (!session.Players.TryGetValue(player, out var data))
                 return;
 
-            if(removeGamerComponent && player.AttachedEntity is {} attachedEntity && EntityManager.TryGetComponent(attachedEntity, out TabletopGamerComponent? gamer))
+            if(removeGamerComponent && player.AttachedEntity is {} attachedEntity && TryComp(attachedEntity, out TabletopGamerComponent? gamer))
             {
                 // We invalidate this to prevent an infinite feedback from removing the component.
                 gamer.Tabletop = EntityUid.Invalid;
 
                 // You stop being a gamer.......
-                EntityManager.RemoveComponent<TabletopGamerComponent>(attachedEntity);
+                RemComp<TabletopGamerComponent>(attachedEntity);
             }
 
             session.Players.Remove(player);
             session.Entities.Remove(data.Camera);
 
             // Deleting the view subscriber automatically cleans up subscriptions, no need to do anything else.
-            EntityManager.QueueDeleteEntity(data.Camera);
+            QueueDel(data.Camera);
         }
 
         /// <summary>
index f3f5801b2d671af3aa78d37b1d5433d1b5e4f1af..e771add0e41a32f3b8a2c0ed7469b95dd9973f5c 100644 (file)
@@ -80,7 +80,7 @@ namespace Content.Server.Tabletop
             if (!_cfg.GetCVar(CCVars.GameTabletopPlace))
                 return;
 
-            if (!EntityManager.TryGetComponent(args.User, out HandsComponent? hands))
+            if (!TryComp(args.User, out HandsComponent? hands))
                 return;
 
             if (component.Session is not { } session)
@@ -128,7 +128,7 @@ namespace Content.Server.Tabletop
             if (!args.CanAccess || !args.CanInteract)
                 return;
 
-            if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
+            if (!TryComp(args.User, out ActorComponent? actor))
                 return;
 
             var playVerb = new ActivationVerb()
@@ -147,7 +147,7 @@ namespace Content.Server.Tabletop
                 return;
 
             // Check that a player is attached to the entity.
-            if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
+            if (!TryComp(args.User, out ActorComponent? actor))
                 return;
 
             OpenSessionFor(actor.PlayerSession, uid);
@@ -171,7 +171,7 @@ namespace Content.Server.Tabletop
 
         private void OnGamerShutdown(EntityUid uid, TabletopGamerComponent component, ComponentShutdown args)
         {
-            if (!EntityManager.TryGetComponent(uid, out ActorComponent? actor))
+            if (!TryComp(uid, out ActorComponent? actor))
                 return;
 
             if(component.Tabletop.IsValid())
@@ -190,7 +190,7 @@ namespace Content.Server.Tabletop
 
                 if (!TryComp(uid, out ActorComponent? actor))
                 {
-                    EntityManager.RemoveComponent<TabletopGamerComponent>(uid);
+                    RemComp<TabletopGamerComponent>(uid);
                     return;
                 }
 
index dd068612f75a4f46bd4b62db730b910b16067247..ab3026fc9773756ee94fca59bdbdecba71095317 100644 (file)
@@ -124,7 +124,7 @@ public sealed class TelephoneSystem : SharedTelephoneSystem
     {
         base.Update(frameTime);
 
-        var query = EntityManager.EntityQueryEnumerator<TelephoneComponent>();
+        var query = EntityQueryEnumerator<TelephoneComponent>();
         while (query.MoveNext(out var uid, out var telephone))
         {
             var entity = new Entity<TelephoneComponent>(uid, telephone);
index 38cbc1859cb68717d8bc7e37907f94eddf26c269..59cb9537f2e48044a160c8d0170c43c31cb32aa2 100644 (file)
@@ -55,7 +55,7 @@ public sealed class TraitSystem : EntitySystem
                 continue;
 
             var coords = Transform(args.Mob).Coordinates;
-            var inhandEntity = EntityManager.SpawnEntity(traitPrototype.TraitGear, coords);
+            var inhandEntity = Spawn(traitPrototype.TraitGear, coords);
             _sharedHandsSystem.TryPickup(args.Mob,
                 inhandEntity,
                 checkActionBlocker: false,
index 7a1e5facd02aba75021079ab15fcdceea4dd396a..871b75f7f0933529b4f81d4d60276c73991e602b 100644 (file)
@@ -29,7 +29,7 @@ namespace Content.Server.Verbs
         {
             var player = eventArgs.SenderSession;
 
-            if (!EntityManager.EntityExists(GetEntity(args.EntityUid)))
+            if (!Exists(GetEntity(args.EntityUid)))
             {
                 Log.Warning($"{nameof(HandleVerbRequest)} called on a non-existent entity with id {args.EntityUid} by player {player}.");
                 return;
index e6a50425b460838f98c360b4b3d94db60ff7afa9..fef52a5b5d2b1d07f048310a62905aac94ee8e36 100644 (file)
@@ -395,7 +395,7 @@ public sealed class WiresSystem : SharedWiresSystem
     {
         var player = args.Actor;
 
-        if (!EntityManager.TryGetComponent(player, out HandsComponent? handsComponent))
+        if (!TryComp(player, out HandsComponent? handsComponent))
         {
             _popupSystem.PopupEntity(Loc.GetString("wires-component-ui-on-receive-message-no-hands"), uid, player);
             return;
@@ -410,7 +410,7 @@ public sealed class WiresSystem : SharedWiresSystem
         if (!_hands.TryGetActiveItem((player, handsComponent), out var heldEntity))
             return;
 
-        if (!EntityManager.TryGetComponent(heldEntity, out ToolComponent? tool))
+        if (!TryComp(heldEntity, out ToolComponent? tool))
             return;
 
         TryDoWireAction(uid, player, heldEntity.Value, args.Id, args.Action, component, tool);
index 807ccc6616d4aac88bbe5b1cda6b85d6226714d5..c05262f2f61061517929f9c7a80af4557ef88aed 100644 (file)
@@ -51,13 +51,13 @@ public sealed class IdExaminableSystem : EntitySystem
         if (_inventorySystem.TryGetSlotEntity(uid, "id", out var idUid))
         {
             // PDA
-            if (EntityManager.TryGetComponent(idUid, out PdaComponent? pda) &&
+            if (TryComp(idUid, out PdaComponent? pda) &&
                 TryComp<IdCardComponent>(pda.ContainedId, out var id))
             {
                 return GetNameAndJob(id);
             }
             // ID Card
-            if (EntityManager.TryGetComponent(idUid, out id))
+            if (TryComp(idUid, out id))
             {
                 return GetNameAndJob(id);
             }
index 72e412b50f688daf76a97f077ad4fa32a94e6411..8cddf2daeb242d117327c84fee80063a6db32bdd 100644 (file)
@@ -54,7 +54,7 @@ public sealed class ActionUpgradeSystem : EntitySystem
 
         // TODO: Preserve ordering of actions
 
-        _entityManager.DeleteEntity(uid);
+        Del(uid);
     }
 
     public bool TryUpgradeAction(EntityUid? actionId, out EntityUid? upgradeActionId, ActionUpgradeComponent? actionUpgradeComponent = null, int newLevel = 0)
@@ -185,7 +185,7 @@ public sealed class ActionUpgradeSystem : EntitySystem
 
         // TODO: Preserve ordering of actions
 
-        _entityManager.DeleteEntity(actionId);
+        Del(actionId);
 
         return upgradedActionId.Value;
     }
index 429c0670ad9cbd5fecccf9251ae4be2e19a4b286..94085c3a2749fcb6ec1f29f796df082bf37e9fe7 100644 (file)
@@ -15,7 +15,7 @@ public abstract class AlertsSystem : EntitySystem
 
     public IReadOnlyDictionary<AlertKey, AlertState>? GetActiveAlerts(EntityUid euid)
     {
-        return EntityManager.TryGetComponent(euid, out AlertsComponent? comp)
+        return TryComp(euid, out AlertsComponent? comp)
             ? comp.Alerts
             : null;
     }
@@ -38,7 +38,7 @@ public abstract class AlertsSystem : EntitySystem
 
     public bool IsShowingAlert(EntityUid euid, ProtoId<AlertPrototype> alertType)
     {
-        if (!EntityManager.TryGetComponent(euid, out AlertsComponent? alertsComponent))
+        if (!TryComp(euid, out AlertsComponent? alertsComponent))
             return false;
 
         if (TryGet(alertType, out var alert))
@@ -53,13 +53,13 @@ public abstract class AlertsSystem : EntitySystem
     /// <returns>true iff an alert of the indicated alert category is currently showing</returns>
     public bool IsShowingAlertCategory(EntityUid euid, ProtoId<AlertCategoryPrototype> alertCategory)
     {
-        return EntityManager.TryGetComponent(euid, out AlertsComponent? alertsComponent)
+        return TryComp(euid, out AlertsComponent? alertsComponent)
                && alertsComponent.Alerts.ContainsKey(AlertKey.ForCategory(alertCategory));
     }
 
     public bool TryGetAlertState(EntityUid euid, AlertKey key, out AlertState alertState)
     {
-        if (EntityManager.TryGetComponent(euid, out AlertsComponent? alertsComponent))
+        if (TryComp(euid, out AlertsComponent? alertsComponent))
             return alertsComponent.Alerts.TryGetValue(key, out alertState);
 
         alertState = default;
@@ -155,7 +155,7 @@ public abstract class AlertsSystem : EntitySystem
         if (_timing.ApplyingState)
             return;
 
-        if (!EntityManager.TryGetComponent(euid, out AlertsComponent? alertsComponent))
+        if (!TryComp(euid, out AlertsComponent? alertsComponent))
             return;
 
         if (TryGet(alertType, out var alert))
@@ -311,14 +311,14 @@ public abstract class AlertsSystem : EntitySystem
     private void HandleClickAlert(ClickAlertEvent msg, EntitySessionEventArgs args)
     {
         var player = args.SenderSession.AttachedEntity;
-        if (player is null || !EntityManager.HasComponent<AlertsComponent>(player))
+        if (player is null || !HasComp<AlertsComponent>(player))
             return;
 
         if (!IsShowingAlert(player.Value, msg.Type))
         {
             Log.Debug("User {0} attempted to" +
                                    " click alert {1} which is not currently showing for them",
-                EntityManager.GetComponent<MetaDataComponent>(player.Value).EntityName, msg.Type);
+                Comp<MetaDataComponent>(player.Value).EntityName, msg.Type);
             return;
         }
 
index 90cc717321d467172b5db03c4aa1252bf35a5f6a..ad813f259a2a05ddc2ff464a4b92871e18c37938 100644 (file)
@@ -71,7 +71,7 @@ public sealed class UdderSystem : EntitySystem
                 continue;
 
             // Actually there is food digestion so no problem with instant reagent generation "OnFeed"
-            if (EntityManager.TryGetComponent(uid, out HungerComponent? hunger))
+            if (TryComp(uid, out HungerComponent? hunger))
             {
                 // Is there enough nutrition to produce reagent?
                 if (_hunger.GetHungerThreshold(hunger) < HungerThreshold.Okay)
@@ -133,7 +133,7 @@ public sealed class UdderSystem : EntitySystem
     {
         if (args.Using == null ||
              !args.CanInteract ||
-             !EntityManager.HasComponent<RefillableSolutionComponent>(args.Using.Value))
+             !HasComp<RefillableSolutionComponent>(args.Using.Value))
             return;
 
         var uid = entity.Owner;
index 172e3b56e14470d99d060a2fa6e013a679567fa2..734de2f34c9b9d3d50c20b8c84ca9be3ce966829 100644 (file)
@@ -65,7 +65,7 @@ public sealed class WoolySystem : EntitySystem
                 continue;
 
             // Actually there is food digestion so no problem with instant reagent generation "OnFeed"
-            if (EntityManager.TryGetComponent(uid, out HungerComponent? hunger))
+            if (TryComp(uid, out HungerComponent? hunger))
             {
                 // Is there enough nutrition to produce reagent?
                 if (_hunger.GetHungerThreshold(hunger) < HungerThreshold.Okay)
index d1066b43e2825c6225d485e6c165de5d0c69b53c..a93f2e061815baf0ee134f25a8a74bb672bb3580 100644 (file)
@@ -158,7 +158,7 @@ public abstract class SharedCryostorageSystem : EntitySystem
         if (PausedMap == null || !Exists(PausedMap))
             return;
 
-        EntityManager.DeleteEntity(PausedMap.Value);
+        Del(PausedMap.Value);
         PausedMap = null;
     }
 
index 97cf9396d27ee683610dbc1bc9d09479e54f2df9..86f6edc903a344c9d16f53a8c0bdf2b659720888 100644 (file)
@@ -179,7 +179,7 @@ public sealed class HypospraySystem : EntitySystem
         RaiseLocalEvent(target, ref ev);
 
         // same LogType as syringes...
-        _adminLogger.Add(LogType.ForceFeed, $"{EntityManager.ToPrettyString(user):user} injected {EntityManager.ToPrettyString(target):target} with a solution {SharedSolutionContainerSystem.ToPrettyString(removedSolution):removedSolution} using a {EntityManager.ToPrettyString(uid):using}");
+        _adminLogger.Add(LogType.ForceFeed, $"{ToPrettyString(user):user} injected {ToPrettyString(target):target} with a solution {SharedSolutionContainerSystem.ToPrettyString(removedSolution):removedSolution} using a {ToPrettyString(uid):using}");
 
         return true;
     }
index e314db0ddba8295f8d9208adb4c7e1aad44e2374..fe4d1025362f100aa496b7cba73c0e1ef7ad48d5 100644 (file)
@@ -282,8 +282,8 @@ public abstract partial class SharedSolutionContainerSystem : EntitySystem
     public FixedPoint2 GetTotalPrototypeQuantity(EntityUid owner, string reagentId)
     {
         var reagentQuantity = FixedPoint2.New(0);
-        if (EntityManager.EntityExists(owner)
-            && EntityManager.TryGetComponent(owner, out SolutionContainerManagerComponent? managerComponent))
+        if (Exists(owner)
+            && TryComp(owner, out SolutionContainerManagerComponent? managerComponent))
         {
             foreach (var (_, soln) in EnumerateSolutions((owner, managerComponent)))
             {
@@ -335,7 +335,7 @@ public abstract partial class SharedSolutionContainerSystem : EntitySystem
         var (uid, comp, appearanceComponent) = soln;
         var solution = comp.Solution;
 
-        if (!EntityManager.EntityExists(uid) || !Resolve(uid, ref appearanceComponent, false))
+        if (!Exists(uid) || !Resolve(uid, ref appearanceComponent, false))
             return;
 
         AppearanceSystem.SetData(uid, SolutionContainerVisuals.FillFraction, solution.FillFraction, appearanceComponent);
index e9d3b7de53d4fef575692f193111d68810b03dcc..68a55dd468aeadd600a12d4817651b3e8f60becc 100644 (file)
@@ -52,7 +52,7 @@ namespace Content.Shared.Chemistry
                     continue;
 
                 _components.RemoveAt(i);
-                EntityManager.RemoveComponent<MovespeedModifierMetabolismComponent>(metabolism);
+                RemComp<MovespeedModifierMetabolismComponent>(metabolism);
 
                 _movespeed.RefreshMovementSpeedModifiers(metabolism);
             }
index cd0996a017eb45f4fe5bd0e24db456e8b32e89f0..e690b9382638f00335618a0a00e309cc7b9b3633 100644 (file)
@@ -122,7 +122,7 @@ public sealed partial class AnchorableSystem : EntitySystem
         _adminLogger.Add(
             LogType.Unanchor,
             LogImpact.Low,
-            $"{EntityManager.ToPrettyString(args.User):user} unanchored {EntityManager.ToPrettyString(uid):anchored} using {EntityManager.ToPrettyString(used):using}"
+            $"{ToPrettyString(args.User):user} unanchored {ToPrettyString(uid):anchored} using {ToPrettyString(used):using}"
         );
     }
 
@@ -174,7 +174,7 @@ public sealed partial class AnchorableSystem : EntitySystem
         _adminLogger.Add(
             LogType.Anchor,
             LogImpact.Low,
-            $"{EntityManager.ToPrettyString(args.User):user} anchored {EntityManager.ToPrettyString(uid):anchored} using {EntityManager.ToPrettyString(used):using}"
+            $"{ToPrettyString(args.User):user} anchored {ToPrettyString(uid):anchored} using {ToPrettyString(used):using}"
         );
     }
 
index 3d49079ea712a26b282639c4401f5975dcec3f92..2eff64aaf08f11c6147fb8e932e4e0b7a762dac8 100644 (file)
@@ -40,7 +40,7 @@ public sealed class ContainerFillSystem : EntitySystem
                 var ent = Spawn(proto, coords);
                 if (!_containerSystem.Insert(ent, container, containerXform: xform))
                 {
-                    var alreadyContained = container.ContainedEntities.Count > 0 ? string.Join("\n", container.ContainedEntities.Select(e => $"\t - {EntityManager.ToPrettyString(e)}")) : "< empty >";
+                    var alreadyContained = container.ContainedEntities.Count > 0 ? string.Join("\n", container.ContainedEntities.Select(e => $"\t - {ToPrettyString(e)}")) : "< empty >";
                     Log.Error($"Entity {ToPrettyString(uid)} with a {nameof(ContainerFillComponent)} failed to insert an entity: {ToPrettyString(ent)}.\nCurrent contents:\n{alreadyContained}");
                     _transform.AttachToGridOrMap(ent);
                     break;
@@ -74,7 +74,7 @@ public sealed class ContainerFillSystem : EntitySystem
                 var spawn = Spawn(proto, coords);
                 if (!_containerSystem.Insert(spawn, container, containerXform: xform))
                 {
-                    var alreadyContained = container.ContainedEntities.Count > 0 ? string.Join("\n", container.ContainedEntities.Select(e => $"\t - {EntityManager.ToPrettyString(e)}")) : "< empty >";
+                    var alreadyContained = container.ContainedEntities.Count > 0 ? string.Join("\n", container.ContainedEntities.Select(e => $"\t - {ToPrettyString(e)}")) : "< empty >";
                     Log.Error($"Entity {ToPrettyString(ent)} with a {nameof(EntityTableContainerFillComponent)} failed to insert an entity: {ToPrettyString(spawn)}.\nCurrent contents:\n{alreadyContained}");
                     _transform.AttachToGridOrMap(spawn);
                     break;
index 4f5f567e435d52154a4a54b0472cbb458f1687df..b3eb4b23c2e63d0f7922837540ca9c1f035f25d4 100644 (file)
@@ -102,7 +102,7 @@ namespace Content.Shared.Containers.ItemSlots
             {
                 if (existing.Local)
                     Log.Error(
-                        $"Duplicate item slot key. Entity: {EntityManager.GetComponent<MetaDataComponent>(uid).EntityName} ({uid}), key: {id}");
+                        $"Duplicate item slot key. Entity: {Comp<MetaDataComponent>(uid).EntityName} ({uid}), key: {id}");
                 else
                     // server state takes priority
                     slot.CopyFrom(existing);
@@ -132,7 +132,7 @@ namespace Content.Shared.Containers.ItemSlots
             itemSlots.Slots.Remove(slot.ContainerSlot.ID);
 
             if (itemSlots.Slots.Count == 0)
-                EntityManager.RemoveComponent(uid, itemSlots);
+                RemComp(uid, itemSlots);
             else
                 Dirty(uid, itemSlots);
         }
@@ -206,7 +206,7 @@ namespace Content.Shared.Containers.ItemSlots
             if (args.Handled)
                 return;
 
-            if (!EntityManager.TryGetComponent(args.User, out HandsComponent? hands))
+            if (!TryComp(args.User, out HandsComponent? hands))
                 return;
 
             if (itemSlots.Slots.Count == 0)
@@ -700,7 +700,7 @@ namespace Content.Shared.Containers.ItemSlots
 
                 var verbSubject = slot.Name != string.Empty
                     ? Loc.GetString(slot.Name)
-                    : EntityManager.GetComponent<MetaDataComponent>(slot.Item.Value).EntityName ?? string.Empty;
+                    : Comp<MetaDataComponent>(slot.Item.Value).EntityName ?? string.Empty;
 
                 AlternativeVerb verb = new()
                 {
index c16bbd1e85a7ee84e4f05ae95346690511894d91..3b0f6c8a30cfe266fe64e2f14abff06908704c88 100644 (file)
@@ -236,7 +236,7 @@ namespace Content.Shared.Cuffs
 
         private void HandleMoveAttempt(EntityUid uid, CuffableComponent component, UpdateCanMoveEvent args)
         {
-            if (component.CanStillInteract || !EntityManager.TryGetComponent(uid, out PullableComponent? pullable) || !pullable.BeingPulled)
+            if (component.CanStillInteract || !TryComp(uid, out PullableComponent? pullable) || !pullable.BeingPulled)
                 return;
 
             args.Cancel();
index c35e95ecb8bacb853307539aa84d628ac0956892..6ef41e87219652081972ac233ef0ff627143e4d9 100644 (file)
@@ -30,7 +30,7 @@ public sealed class DamageOnHighSpeedImpactSystem : EntitySystem
         if (!args.OurFixture.Hard || !args.OtherFixture.Hard)
             return;
 
-        if (!EntityManager.HasComponent<DamageableComponent>(uid))
+        if (!HasComp<DamageableComponent>(uid))
             return;
 
         //TODO: This should solve after physics solves
index 6b5f57c595e58ffdfe34ed0ebc3818eef13dbceb..e339727200df193dad10f302843ca331d0686b9c 100644 (file)
@@ -30,7 +30,7 @@ namespace Content.Shared.Damage
 
         private void OnRefreshMovespeed(EntityUid uid, SlowOnDamageComponent component, RefreshMovementSpeedModifiersEvent args)
         {
-            if (!EntityManager.TryGetComponent<DamageableComponent>(uid, out var damage))
+            if (!TryComp<DamageableComponent>(uid, out var damage))
                 return;
 
             if (damage.TotalDamage == FixedPoint2.Zero)
index cb7a8c46c8b7239cee6d3d53cb0eff32937eff42..077649f7a8a7df2414e6655fe425735cc6bc9d56 100644 (file)
@@ -156,7 +156,7 @@ public abstract class SharedMailingUnitSystem : EntitySystem
         if (args.Handled || !args.Complex)
             return;
 
-        if (!EntityManager.TryGetComponent(args.User, out ActorComponent? actor))
+        if (!TryComp(args.User, out ActorComponent? actor))
         {
             return;
         }
index 228926fac45e1e1d8dd697984440ea3cb98dd254..7c063f6ce988fa04720ac07ce37f2c6b9831922c 100644 (file)
@@ -111,7 +111,7 @@ namespace Content.Shared.Examine
             if (!examinerComp.CheckInRangeUnOccluded)
                 return true;
 
-            if (EntityManager.GetComponent<TransformComponent>(examiner).MapID != target.MapId)
+            if (Comp<TransformComponent>(examiner).MapID != target.MapId)
                 return false;
 
             // Do target InRangeUnoccluded which has different checks.
index 2f532d0f1d34140daa88e7b77bdf33add6884fb5..3ff9792e86d5b0d106de4994687cf9f8b81b85a6 100644 (file)
@@ -148,7 +148,7 @@ namespace Content.Shared.Gravity
 
         private void OnGridInit(GridInitializeEvent ev)
         {
-            EntityManager.EnsureComponent<GravityComponent>(ev.EntityUid);
+            EnsureComp<GravityComponent>(ev.EntityUid);
         }
 
         [Serializable, NetSerializable]
index 41c2daed3ebcf92c6b10a38bdaccfdb055c2b324..6e806384a0a69fc225ff929b1e47da15c83fe221 100644 (file)
@@ -56,7 +56,7 @@ public abstract class SharedImplanterSystem : EntitySystem
 
     private void OnEntInserted(EntityUid uid, ImplanterComponent component, EntInsertedIntoContainerMessage args)
     {
-        var implantData = EntityManager.GetComponent<MetaDataComponent>(args.Entity);
+        var implantData = Comp<MetaDataComponent>(args.Entity);
         component.ImplantData = (implantData.EntityName, implantData.EntityDescription);
     }
 
index 44dede02c76e77bcf8fb7a0faaf711658e91b143..259c3b6c8df2a6395b71814ca72d7045e32f42f9 100644 (file)
@@ -73,12 +73,12 @@ public partial class InventorySystem
             return false;
 
         // Let's spawn this first...
-        var item = EntityManager.SpawnEntity(prototype, Transform(uid).Coordinates);
+        var item = Spawn(prototype, Transform(uid).Coordinates);
 
         // Helper method that deletes the item and returns false.
         bool DeleteItem()
         {
-            EntityManager.DeleteEntity(item);
+            Del(item);
             return false;
         }
 
index 1ac8413375e60c7081aa705c0314a6a39a9d7000..fd0758c3c4a78e104d7d87629d9b954b6e9947e1 100644 (file)
@@ -25,7 +25,7 @@ namespace Content.Shared.Jittering
 
         private void OnRejuvenate(EntityUid uid, JitteringComponent component, RejuvenateEvent args)
         {
-            EntityManager.RemoveComponentDeferred<JitteringComponent>(uid);
+            RemCompDeferred<JitteringComponent>(uid);
         }
 
         /// <summary>
@@ -54,7 +54,7 @@ namespace Content.Shared.Jittering
 
             if (StatusEffects.TryAddStatusEffect<JitteringComponent>(uid, "Jitter", time, refresh, status))
             {
-                var jittering = EntityManager.GetComponent<JitteringComponent>(uid);
+                var jittering = Comp<JitteringComponent>(uid);
 
                 if(forceValueChange || jittering.Amplitude < amplitude)
                     jittering.Amplitude = amplitude;
index a860f1dcfb7287bd845bd51a2b283076ba68d88f..e5258f25183489801b8b9322c23270793f31fdc5 100644 (file)
@@ -359,7 +359,7 @@ public abstract class SharedMagicSystem : EntitySystem
             var component = (Component)Factory.GetComponent(name);
             var temp = (object)component;
             _seriMan.CopyTo(data.Component, ref temp);
-            EntityManager.AddComponent(target, (Component)temp!);
+            AddComp(target, (Component)temp!);
         }
     }
 
index e1c07df3c34c37bb5fde03ef01f8302b3536dda3..bc169aa201af94ed4b5f0a3348c32178b5661f4b 100644 (file)
@@ -226,7 +226,7 @@ public sealed class PullingSystem : EntitySystem
         if (component.Pulling != args.BlockingEntity)
             return;
 
-        if (EntityManager.TryGetComponent(args.BlockingEntity, out PullableComponent? comp))
+        if (TryComp(args.BlockingEntity, out PullableComponent? comp))
         {
             TryStopPull(args.BlockingEntity, comp);
         }
@@ -424,7 +424,7 @@ public sealed class PullingSystem : EntitySystem
             return false;
         }
 
-        if (!EntityManager.TryGetComponent<PhysicsComponent>(pullableUid, out var physics))
+        if (!TryComp<PhysicsComponent>(pullableUid, out var physics))
         {
             return false;
         }
index 09d74bfb40a23b60158762527c568069ff791c6c..44fc3933e306f4154e627677f0acd08572d4fb0d 100644 (file)
@@ -77,7 +77,7 @@ public sealed class FrictionContactsSystem : EntitySystem
 
     private void OnRefreshFrictionModifiers(Entity<FrictionModifiedByContactComponent> entity, ref RefreshFrictionModifiersEvent args)
     {
-        if (!EntityManager.TryGetComponent<PhysicsComponent>(entity, out var physicsComponent))
+        if (!TryComp<PhysicsComponent>(entity, out var physicsComponent))
             return;
 
         var friction = 0.0f;
index e2dee870191824088be6f797cd66327c0a5a319d..8a0b085a83201066f59f5829498e76f1ce0c892b 100644 (file)
@@ -78,7 +78,7 @@ public sealed class SpeedModifierContactsSystem : EntitySystem
 
     private void OnRefreshMovementSpeedModifiers(EntityUid uid, SpeedModifiedByContactComponent component, RefreshMovementSpeedModifiersEvent args)
     {
-        if (!EntityManager.TryGetComponent<PhysicsComponent>(uid, out var physicsComponent))
+        if (!TryComp<PhysicsComponent>(uid, out var physicsComponent))
             return;
 
         var walkSpeed = 0.0f;
index bd7251b9438327a2ab2800d380272ec3b22523b6..fa07aa20c5de874d835e414a7787beb28d51f0a9 100644 (file)
@@ -40,7 +40,7 @@ namespace Content.Shared.Nutrition.EntitySystems
 
             creamPied.CreamPied = value;
 
-            if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
+            if (TryComp(uid, out AppearanceComponent? appearance))
             {
                 _appearance.SetData(uid, CreamPiedVisuals.Creamed, value, appearance);
             }
@@ -58,7 +58,7 @@ namespace Content.Shared.Nutrition.EntitySystems
 
         private void OnCreamPiedHitBy(EntityUid uid, CreamPiedComponent creamPied, ThrowHitByEvent args)
         {
-            if (!EntityManager.EntityExists(args.Thrown) || !EntityManager.TryGetComponent(args.Thrown, out CreamPieComponent? creamPie)) return;
+            if (!Exists(args.Thrown) || !TryComp(args.Thrown, out CreamPieComponent? creamPie)) return;
 
             SetCreamPied(uid, creamPied, true);
 
index 431302593d797c099da53b4e7cfcdf87086a628d..63fe822186645a3d388827bc29a56799f54c465c 100644 (file)
@@ -38,7 +38,7 @@ public sealed class UtensilSystem : EntitySystem
 
     public (bool Success, bool Handled) TryUseUtensil(EntityUid user, EntityUid target, Entity<UtensilComponent> utensil)
     {
-        if (!EntityManager.TryGetComponent(target, out FoodComponent? food))
+        if (!TryComp(target, out FoodComponent? food))
             return (false, false);
 
         //Prevents food usage with a wrong utensil
@@ -67,7 +67,7 @@ public sealed class UtensilSystem : EntitySystem
         if (_robustRandom.Prob(component.BreakChance))
         {
             _audio.PlayPredicted(component.BreakSound, userUid, userUid, AudioParams.Default.WithVolume(-2f));
-            EntityManager.DeleteEntity(uid);
+            Del(uid);
         }
     }
 }
index 04d6d4026cf63afd4e043c4e164846c6783069ab..75496d93b4083fd50c0fe67565c6a82cd5d6f9c4 100644 (file)
@@ -217,7 +217,7 @@ public sealed class PaperSystem : EntitySystem
     {
         if (!_paperQuery.TryComp(ent, out var paperComp))
         {
-            Log.Warning($"{EntityManager.ToPrettyString(ent)} has a {nameof(RandomPaperContentComponent)} but no {nameof(PaperComponent)}!");
+            Log.Warning($"{ToPrettyString(ent)} has a {nameof(RandomPaperContentComponent)} but no {nameof(PaperComponent)}!");
             RemCompDeferred(ent, ent.Comp);
             return;
         }
index 68056ef267beb63022c2d53db2cc50cec29a058f..cb8450a50063b7d59cc2badc55eb2182dd2ea98a 100644 (file)
@@ -206,7 +206,7 @@ public sealed class RCDSystem : EntitySystem
 
         // Try to start the do after
         var effect = Spawn(effectPrototype, location);
-        var ev = new RCDDoAfterEvent(GetNetCoordinates(location), component.ConstructionDirection, component.ProtoId, cost, EntityManager.GetNetEntity(effect));
+        var ev = new RCDDoAfterEvent(GetNetCoordinates(location), component.ConstructionDirection, component.ProtoId, cost, GetNetEntity(effect));
 
         var doAfterArgs = new DoAfterArgs(EntityManager, user, delay, ev, uid, target: args.Target, used: uid)
         {
@@ -261,7 +261,7 @@ public sealed class RCDSystem : EntitySystem
         {
             // Delete the effect entity if the do-after was cancelled (server-side only)
             if (_net.IsServer)
-                QueueDel(EntityManager.GetEntity(args.Effect));
+                QueueDel(GetEntity(args.Effect));
             return;
         }
 
index c2b52c5af356e61454e1a53f6ee381dc86efabe3..a791a706687066c7c1b6a04ae9f62161a0f5ed87 100644 (file)
@@ -172,7 +172,7 @@ public abstract class SharedEventHorizonSystem : EntitySystem
             _physics.SetHard(uid, collider, true, fixtures);
         }
 
-        EntityManager.Dirty(uid, fixtures);
+        Dirty(uid, fixtures);
     }
 
     #endregion Getters/Setters
index a0a2257402bb59d37e78315a2faf7bd200acab8b..ac65bd558410296275cd38fb62936004f1ad3595 100644 (file)
@@ -127,7 +127,7 @@ public abstract class SharedStationSpawningSystem : EntitySystem
                 var equipmentStr = startingGear.GetGear(slot.Name);
                 if (!string.IsNullOrEmpty(equipmentStr))
                 {
-                    var equipmentEntity = EntityManager.SpawnEntity(equipmentStr, xform.Coordinates);
+                    var equipmentEntity = Spawn(equipmentStr, xform.Coordinates);
                     InventorySystem.TryEquip(entity, equipmentEntity, slot.Name, silent: true, force: true);
                 }
             }
@@ -139,7 +139,7 @@ public abstract class SharedStationSpawningSystem : EntitySystem
             var coords = xform.Coordinates;
             foreach (var prototype in inhand)
             {
-                var inhandEntity = EntityManager.SpawnEntity(prototype, coords);
+                var inhandEntity = Spawn(prototype, coords);
 
                 if (_handsSystem.TryGetEmptyHand((entity, handsComponent), out var emptyHand))
                 {
index 9a73f83d34e9891b4f9db4054de767f5fd551b7e..f3409d1c2c81ef09459ab406972933b150a6ff76 100644 (file)
@@ -120,7 +120,7 @@ namespace Content.Shared.StatusEffect
             if (HasComp<T>(uid))
                 return true;
 
-            EntityManager.AddComponent<T>(uid);
+            AddComp<T>(uid);
             status.ActiveEffects[key].RelevantComponent = Factory.GetComponentName<T>();
             return true;
 
@@ -136,10 +136,10 @@ namespace Content.Shared.StatusEffect
             if (TryAddStatusEffect(uid, key, time, refresh, status))
             {
                 // If they already have the comp, we just won't bother updating anything.
-                if (!EntityManager.HasComponent(uid, Factory.GetRegistration(component).Type))
+                if (!HasComp(uid, Factory.GetRegistration(component).Type))
                 {
                     var newComponent = (Component) Factory.GetComponent(component);
-                    EntityManager.AddComponent(uid, newComponent);
+                    AddComp(uid, newComponent);
                     status.ActiveEffects[key].RelevantComponent = component;
                 }
                 return true;
@@ -279,7 +279,7 @@ namespace Content.Shared.StatusEffect
                 && Factory.TryGetRegistration(state.RelevantComponent, out var registration))
             {
                 var type = registration.Type;
-                EntityManager.RemoveComponent(uid, type);
+                RemComp(uid, type);
             }
 
             if (proto.Alert != null)
index 8ef62c45c49645a02e9eec8f4d9ad8f493c5e04b..62f91d8663d69ce1f0cb67daff76901aa782af83 100644 (file)
@@ -21,7 +21,7 @@ namespace Content.Shared.Storage.EntitySystems
         private void CounterEntityInserted(EntityUid uid, ItemCounterComponent itemCounter,
             EntInsertedIntoContainerMessage args)
         {
-            if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearanceComponent))
+            if (!TryComp(uid, out AppearanceComponent? appearanceComponent))
                 return;
 
             var count = GetCount(args, itemCounter);
@@ -37,7 +37,7 @@ namespace Content.Shared.Storage.EntitySystems
         private void CounterEntityRemoved(EntityUid uid, ItemCounterComponent itemCounter,
             EntRemovedFromContainerMessage args)
         {
-            if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearanceComponent))
+            if (!TryComp(uid, out AppearanceComponent? appearanceComponent))
                 return;
 
             var count = GetCount(args, itemCounter);
index 7ae821d8d91b98e1b8e1f41de00b0dca01c71525..3b4b08bbfd7f65df2dce5775cd32ded447099a25 100644 (file)
@@ -34,7 +34,7 @@ public abstract class SharedItemMapperSystem : EntitySystem
             val.Layer = layerName;
         }
 
-        if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearanceComponent))
+        if (TryComp(uid, out AppearanceComponent? appearanceComponent))
         {
             var list = new List<string>(component.MapLayers.Keys);
             _appearance.SetData(uid, StorageMapVisuals.InitLayers, new ShowLayerData(list), appearanceComponent);
@@ -67,7 +67,7 @@ public abstract class SharedItemMapperSystem : EntitySystem
         if (!Resolve(uid, ref itemMapper))
             return;
 
-        if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearanceComponent)
+        if (TryComp(uid, out AppearanceComponent? appearanceComponent)
             && TryGetLayers(uid, itemMapper, out var containedLayers))
         {
             _appearance.SetData(uid,
index c7edf014990e1ad7a3ad194643dfcd2964b7010a..822b8acaf00779adc60536b4677621c83cd36d6e 100644 (file)
@@ -92,13 +92,13 @@ namespace Content.Shared.SubFloor
         {
             UpdateFloorCover(uid, component);
             UpdateAppearance(uid, component);
-            EntityManager.EnsureComponent<CollideOnAnchorComponent>(uid);
+            EnsureComp<CollideOnAnchorComponent>(uid);
         }
 
         private void OnSubFloorTerminating(EntityUid uid, SubFloorHideComponent component, ComponentShutdown _)
         {
             // If component is being deleted don't need to worry about updating any component stuff because it won't matter very shortly.
-            if (EntityManager.GetComponent<MetaDataComponent>(uid).EntityLifeStage >= EntityLifeStage.Terminating)
+            if (Comp<MetaDataComponent>(uid).EntityLifeStage >= EntityLifeStage.Terminating)
                 return;
 
             // Regardless of whether we're on a subfloor or not, unhide.
index 03dd094805c2dd66f4453d6d5f884e8bb8533003..ab6fe94fdb350cc5abc804b0bd6614aa87255910 100644 (file)
@@ -39,7 +39,7 @@ namespace Content.Shared.Tabletop
                 return;
 
             // Move the entity and dirty it (we use the map ID from the entity so noone can try to be funny and move the item to another map)
-            var transform = EntityManager.GetComponent<TransformComponent>(moved);
+            var transform = Comp<TransformComponent>(moved);
             Transforms.SetParent(moved, transform, _mapSystem.GetMapOrInvalid(transform.MapID));
             Transforms.SetLocalPositionNoLerp(moved, msg.Coordinates.Position, transform);
         }
index 3e1a4f18ded5d5d6c1fc7078d4c74da2e0c3b01e..65c5a0f13ef6ddf2ab88a7d0c00472d72f1482da 100644 (file)
@@ -47,7 +47,7 @@ namespace Content.Shared.Throwing
 
         private void ThrowItem(EntityUid uid, ThrownItemComponent component, ref ThrownEvent @event)
         {
-            if (!EntityManager.TryGetComponent(uid, out FixturesComponent? fixturesComponent) ||
+            if (!TryComp(uid, out FixturesComponent? fixturesComponent) ||
                 fixturesComponent.Fixtures.Count != 1 ||
                 !TryComp<PhysicsComponent>(uid, out var body))
             {
@@ -86,7 +86,7 @@ namespace Content.Shared.Throwing
         private void HandlePullStarted(PullStartedMessage message)
         {
             // TODO: this isn't directed so things have to be done the bad way
-            if (EntityManager.TryGetComponent(message.PulledUid, out ThrownItemComponent? thrownItemComponent))
+            if (TryComp(message.PulledUid, out ThrownItemComponent? thrownItemComponent))
                 StopThrow(message.PulledUid, thrownItemComponent);
         }
 
@@ -100,7 +100,7 @@ namespace Content.Shared.Throwing
                     _broadphase.RegenerateContacts((uid, physics));
             }
 
-            if (EntityManager.TryGetComponent(uid, out FixturesComponent? manager))
+            if (TryComp(uid, out FixturesComponent? manager))
             {
                 var fixture = _fixtures.GetFixtureOrNull(uid, ThrowingFixture, manager: manager);
 
index 595ef8a9252c64e1029886635ca0fb8406a6cd30..5a5d719ddef0dac0c5b9e0d542d74034744d58b1 100644 (file)
@@ -22,7 +22,7 @@ public abstract partial class SharedToolSystem
     private void OnMultipleToolStartup(EntityUid uid, MultipleToolComponent multiple, ComponentStartup args)
     {
         // Only set the multiple tool if we have a tool component.
-        if (EntityManager.TryGetComponent(uid, out ToolComponent? tool))
+        if (TryComp(uid, out ToolComponent? tool))
             SetMultipleTool(uid, multiple, tool);
     }
 
index 953abc81077038163f138c6c72e073bc528627e5..bd44dcfd6658d2f5b8c03299613aa1223f736e0b 100644 (file)
@@ -294,7 +294,7 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
         {
             // Make sure the entity is a weapon AND it doesn't need
             // to be equipped to be used (E.g boxing gloves).
-            if (EntityManager.TryGetComponent(held, out melee) &&
+            if (TryComp(held, out melee) &&
                 !melee.MustBeEquippedToUse)
             {
                 weaponUid = held.Value;
index 38f427429f90ba43aa98bf5c5ae918c8d4d7c002..29664c6eea48579302ff16277ff6e2f9c67ff011 100644 (file)
@@ -100,7 +100,7 @@ public partial class SharedGunSystem
             return false;
 
         // If it's a speedloader try to get ammo from it.
-        if (EntityManager.HasComponent<SpeedLoaderComponent>(uid))
+        if (HasComp<SpeedLoaderComponent>(uid))
         {
             var freeSlots = 0;
 
index b6dee7fc1bae45d1d02866c1c66cfdf80bc28f69..982b8c13453f72dd3d662f080dc04a04e7da7733 100644 (file)
@@ -121,7 +121,7 @@ public abstract partial class SharedGunSystem : EntitySystem
         if (melee.NextAttack > component.NextFire)
         {
             component.NextFire = melee.NextAttack;
-            EntityManager.DirtyField(uid, component, nameof(GunComponent.NextFire));
+            DirtyField(uid, component, nameof(GunComponent.NextFire));
         }
     }
 
@@ -201,7 +201,7 @@ public abstract partial class SharedGunSystem : EntitySystem
         gun.ShotCounter = 0;
         gun.ShootCoordinates = null;
         gun.Target = null;
-        EntityManager.DirtyField(uid, gun, nameof(GunComponent.ShotCounter));
+        DirtyField(uid, gun, nameof(GunComponent.ShotCounter));
     }
 
     /// <summary>
@@ -212,7 +212,7 @@ public abstract partial class SharedGunSystem : EntitySystem
         gun.ShootCoordinates = toCoordinates;
         AttemptShoot(user, gunUid, gun);
         gun.ShotCounter = 0;
-        EntityManager.DirtyField(gunUid, gun, nameof(GunComponent.ShotCounter));
+        DirtyField(gunUid, gun, nameof(GunComponent.ShotCounter));
     }
 
     /// <summary>
@@ -281,7 +281,7 @@ public abstract partial class SharedGunSystem : EntitySystem
         }
 
         // NextFire has been touched regardless so need to dirty the gun.
-        EntityManager.DirtyField(gunUid, gun, nameof(GunComponent.NextFire));
+        DirtyField(gunUid, gun, nameof(GunComponent.NextFire));
 
         // Get how many shots we're actually allowed to make, due to clip size or otherwise.
         // Don't do this in the loop so we still reset NextFire.
@@ -335,7 +335,7 @@ public abstract partial class SharedGunSystem : EntitySystem
         // Even if we don't actually shoot update the ShotCounter. This is to avoid spamming empty sounds
         // where the gun may be SemiAuto or Burst.
         gun.ShotCounter += shots;
-        EntityManager.DirtyField(gunUid, gun, nameof(GunComponent.ShotCounter));
+        DirtyField(gunUid, gun, nameof(GunComponent.ShotCounter));
 
         if (ev.Ammo.Count <= 0)
         {
index e5bd33f58147fedcad5b2d10592a9e4d5d09909c..e36729851f04830d513f645a2ec0a64a2a0be280 100644 (file)
@@ -21,18 +21,18 @@ public sealed class XAEApplyComponentsSystem : BaseXAESystem<XAEApplyComponentsC
         foreach (var registry in ent.Comp.Components)
         {
             var componentType = registry.Value.Component.GetType();
-            if (!ent.Comp.ApplyIfAlreadyHave && EntityManager.HasComponent(artifact, componentType))
+            if (!ent.Comp.ApplyIfAlreadyHave && HasComp(artifact, componentType))
             {
                 continue;
             }
 
             if (ent.Comp.RefreshOnReactivate)
             {
-                EntityManager.RemoveComponent(artifact, componentType);
+                RemComp(artifact, componentType);
             }
 
             var clone = EntityManager.ComponentFactory.GetComponent(registry.Value);
-            EntityManager.AddComponent(artifact, clone);
+            AddComp(artifact, clone);
         }
     }
 }