]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Kill `SharedUnoccludedExtensions` (#20914)
authorKara <lunarautomaton6@gmail.com>
Sat, 14 Oct 2023 16:42:37 +0000 (09:42 -0700)
committerGitHub <noreply@github.com>
Sat, 14 Oct 2023 16:42:37 +0000 (03:42 +1100)
Content.Server/Administration/Systems/AdminVerbSystem.cs
Content.Server/Pointing/EntitySystems/PointingSystem.cs
Content.Shared/Examine/ExamineSystemShared.cs
Content.Shared/Interaction/Helpers/SharedUnoccludedExtensions.cs [deleted file]

index 4ed8e19f553f7af38404dd210e2f75ad961d5520..709602a1b3c06051586f7413ae36a06f567964fb 100644 (file)
@@ -15,8 +15,8 @@ using Content.Server.Xenoarchaeology.XenoArtifacts.Triggers.Components;
 using Content.Shared.Administration;
 using Content.Shared.Configurable;
 using Content.Shared.Database;
+using Content.Shared.Examine;
 using Content.Shared.GameTicking;
-using Content.Shared.Interaction.Helpers;
 using Content.Shared.Inventory;
 using Content.Shared.Mind;
 using Content.Shared.Mind.Components;
@@ -353,7 +353,8 @@ namespace Content.Server.Administration.Systems
                     Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/information.svg.192dpi.png")),
                     Act = () =>
                     {
-                        var message = args.User.InRangeUnOccluded(args.Target)
+
+                        var message = ExamineSystemShared.InRangeUnOccluded(args.User, args.Target)
                             ? Loc.GetString("in-range-unoccluded-verb-on-activate-not-occluded")
                             : Loc.GetString("in-range-unoccluded-verb-on-activate-occluded");
                         args.Target.PopupMessage(args.User, message);
index 8756134310bde26cc37217e55fdfc176011579c0..8f00125ea396e46c4319c6af2c42caf2891ec1e9 100644 (file)
@@ -3,12 +3,12 @@ using Content.Server.Administration.Logs;
 using Content.Server.Pointing.Components;
 using Content.Shared.Bed.Sleep;
 using Content.Shared.Database;
+using Content.Shared.Examine;
 using Content.Shared.Eye;
 using Content.Shared.Ghost;
 using Content.Shared.IdentityManagement;
 using Content.Shared.Input;
 using Content.Shared.Interaction;
-using Content.Shared.Interaction.Helpers;
 using Content.Shared.Mind;
 using Content.Shared.Mobs.Systems;
 using Content.Shared.Pointing;
@@ -94,7 +94,7 @@ namespace Content.Server.Pointing.EntitySystems
             }
             else
             {
-                return pointer.InRangeUnOccluded(coordinates, 15, e => e == pointer);
+                return ExamineSystemShared.InRangeUnOccluded(pointer, coordinates, 15, predicate: e => e == pointer);
             }
         }
 
index 81fc016904191e796435b9ed119c7fd0e982c0ec..2e0cffd7d27729b6469456fcc72a5a4a45ebbe48 100644 (file)
@@ -204,7 +204,7 @@ namespace Content.Shared.Examine
             return true;
         }
 
-        public static bool InRangeUnOccluded(EntityUid origin, EntityUid other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
+        public static bool InRangeUnOccluded(EntityUid origin, EntityUid other, float range = ExamineRange, Ignored? predicate = null, bool ignoreInsideBlocker = true)
         {
             var entMan = IoCManager.Resolve<IEntityManager>();
             var originPos = entMan.GetComponent<TransformComponent>(origin).MapPosition;
@@ -213,7 +213,7 @@ namespace Content.Shared.Examine
             return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
         }
 
-        public static bool InRangeUnOccluded(EntityUid origin, IComponent other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
+        public static bool InRangeUnOccluded(EntityUid origin, IComponent other, float range = ExamineRange, Ignored? predicate = null, bool ignoreInsideBlocker = true)
         {
             var entMan = IoCManager.Resolve<IEntityManager>();
             var originPos = entMan.GetComponent<TransformComponent>(origin).MapPosition;
@@ -222,7 +222,7 @@ namespace Content.Shared.Examine
             return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
         }
 
-        public static bool InRangeUnOccluded(EntityUid origin, EntityCoordinates other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
+        public static bool InRangeUnOccluded(EntityUid origin, EntityCoordinates other, float range = ExamineRange, Ignored? predicate = null, bool ignoreInsideBlocker = true)
         {
             var entMan = IoCManager.Resolve<IEntityManager>();
             var originPos = entMan.GetComponent<TransformComponent>(origin).MapPosition;
@@ -231,7 +231,7 @@ namespace Content.Shared.Examine
             return InRangeUnOccluded(originPos, otherPos, range, predicate, ignoreInsideBlocker);
         }
 
-        public static bool InRangeUnOccluded(EntityUid origin, MapCoordinates other, float range, Ignored? predicate, bool ignoreInsideBlocker = true)
+        public static bool InRangeUnOccluded(EntityUid origin, MapCoordinates other, float range = ExamineRange, Ignored? predicate = null, bool ignoreInsideBlocker = true)
         {
             var entMan = IoCManager.Resolve<IEntityManager>();
             var originPos = entMan.GetComponent<TransformComponent>(origin).MapPosition;
diff --git a/Content.Shared/Interaction/Helpers/SharedUnoccludedExtensions.cs b/Content.Shared/Interaction/Helpers/SharedUnoccludedExtensions.cs
deleted file mode 100644 (file)
index 9ea48a8..0000000
+++ /dev/null
@@ -1,347 +0,0 @@
-using Content.Shared.DragDrop;
-using Content.Shared.Examine;
-using Robust.Shared.Containers;
-using Robust.Shared.Map;
-using static Content.Shared.Examine.ExamineSystemShared;
-using static Content.Shared.Interaction.SharedInteractionSystem;
-
-namespace Content.Shared.Interaction.Helpers
-{
-    public static class SharedUnoccludedExtensions
-    {
-        #region Entities
-        public static bool InRangeUnOccluded(
-            this EntityUid origin,
-            EntityUid other,
-            float range = ExamineRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            return ExamineSystemShared.InRangeUnOccluded(origin, other, range, predicate, ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this EntityUid origin,
-            IComponent other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            return ExamineSystemShared.InRangeUnOccluded(origin, other, range, predicate, ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this EntityUid origin,
-            BaseContainer other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var otherEntity = other.Owner;
-
-            return ExamineSystemShared.InRangeUnOccluded(origin, otherEntity, range, predicate, ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this EntityUid origin,
-            EntityCoordinates other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            return ExamineSystemShared.InRangeUnOccluded(origin, other, range, predicate, ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this EntityUid origin,
-            MapCoordinates other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            return ExamineSystemShared.InRangeUnOccluded(origin, other, range, predicate, ignoreInsideBlocker);
-        }
-        #endregion
-
-        #region Components
-        public static bool InRangeUnOccluded(
-            this IComponent origin,
-            EntityUid other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var originEntity = origin.Owner;
-
-            return ExamineSystemShared.InRangeUnOccluded(originEntity, other, range, predicate, ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this IComponent origin,
-            IComponent other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var originEntity = origin.Owner;
-
-            return ExamineSystemShared.InRangeUnOccluded(originEntity, other, range, predicate, ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this IComponent origin,
-            BaseContainer other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var originEntity = origin.Owner;
-            var otherEntity = other.Owner;
-
-            return ExamineSystemShared.InRangeUnOccluded(originEntity, otherEntity, range, predicate,
-                ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this IComponent origin,
-            EntityCoordinates other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var originEntity = origin.Owner;
-
-            return ExamineSystemShared.InRangeUnOccluded(originEntity, other, range, predicate, ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this IComponent origin,
-            MapCoordinates other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var originEntity = origin.Owner;
-
-            return ExamineSystemShared.InRangeUnOccluded(originEntity, other, range, predicate,
-                ignoreInsideBlocker);
-        }
-        #endregion
-
-        #region Containers
-        public static bool InRangeUnOccluded(
-            this BaseContainer origin,
-            EntityUid other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var originEntity = origin.Owner;
-
-            return ExamineSystemShared.InRangeUnOccluded(originEntity, other, range, predicate,
-                ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this BaseContainer origin,
-            IComponent other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var originEntity = origin.Owner;
-
-            return ExamineSystemShared.InRangeUnOccluded(originEntity, other, range, predicate, ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this BaseContainer origin,
-            BaseContainer other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var originEntity = origin.Owner;
-            var otherEntity = other.Owner;
-
-            return ExamineSystemShared.InRangeUnOccluded(originEntity, otherEntity, range, predicate,
-                ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this BaseContainer origin,
-            EntityCoordinates other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var originEntity = origin.Owner;
-
-            return ExamineSystemShared.InRangeUnOccluded(originEntity, other, range, predicate, ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this BaseContainer origin,
-            MapCoordinates other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var originEntity = origin.Owner;
-
-            return ExamineSystemShared.InRangeUnOccluded(originEntity, other, range, predicate, ignoreInsideBlocker);
-        }
-        #endregion
-
-        #region EntityCoordinates
-        public static bool InRangeUnOccluded(
-            this EntityCoordinates origin,
-            EntityUid other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var entMan = IoCManager.Resolve<IEntityManager>();
-            var originPosition = origin.ToMap(entMan);
-            var otherPosition = entMan.GetComponent<TransformComponent>(other).MapPosition;
-
-            return ExamineSystemShared.InRangeUnOccluded(originPosition, otherPosition, range,
-                predicate, ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this EntityCoordinates origin,
-            IComponent other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var entMan = IoCManager.Resolve<IEntityManager>();
-            var originPosition = origin.ToMap(entMan);
-            var otherPosition = entMan.GetComponent<TransformComponent>(other.Owner).MapPosition;
-
-            return ExamineSystemShared.InRangeUnOccluded(originPosition, otherPosition, range,
-                predicate, ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this EntityCoordinates origin,
-            BaseContainer other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var entMan = IoCManager.Resolve<IEntityManager>();
-            var originPosition = origin.ToMap(entMan);
-            var otherPosition = entMan.GetComponent<TransformComponent>(other.Owner).MapPosition;
-
-            return ExamineSystemShared.InRangeUnOccluded(originPosition, otherPosition, range,
-                predicate, ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this EntityCoordinates origin,
-            EntityCoordinates other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true,
-            IEntityManager? entityManager = null)
-        {
-            IoCManager.Resolve(ref entityManager);
-
-            var originPosition = origin.ToMap(entityManager);
-            var otherPosition = other.ToMap(entityManager);
-
-            return ExamineSystemShared.InRangeUnOccluded(originPosition, otherPosition, range,
-                predicate, ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this EntityCoordinates origin,
-            MapCoordinates other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true,
-            IEntityManager? entityManager = null)
-        {
-            IoCManager.Resolve(ref entityManager);
-
-            var originPosition = origin.ToMap(entityManager);
-
-            return ExamineSystemShared.InRangeUnOccluded(originPosition, other, range, predicate,
-                ignoreInsideBlocker);
-        }
-        #endregion
-
-        #region MapCoordinates
-        public static bool InRangeUnOccluded(
-            this MapCoordinates origin,
-            EntityUid other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var entMan = IoCManager.Resolve<IEntityManager>();
-            var otherPosition = entMan.GetComponent<TransformComponent>(other).MapPosition;
-
-            return ExamineSystemShared.InRangeUnOccluded(origin, otherPosition, range, predicate,
-                ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this MapCoordinates origin,
-            IComponent other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var entMan = IoCManager.Resolve<IEntityManager>();
-            var otherPosition = entMan.GetComponent<TransformComponent>(other.Owner).MapPosition;
-
-            return ExamineSystemShared.InRangeUnOccluded(origin, otherPosition, range, predicate,
-                ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this MapCoordinates origin,
-            BaseContainer other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            var entMan = IoCManager.Resolve<IEntityManager>();
-            var otherPosition = entMan.GetComponent<TransformComponent>(other.Owner).MapPosition;
-
-            return ExamineSystemShared.InRangeUnOccluded(origin, otherPosition, range, predicate,
-                ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this MapCoordinates origin,
-            EntityCoordinates other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true,
-            IEntityManager? entityManager = null)
-        {
-            IoCManager.Resolve(ref entityManager);
-
-            var otherPosition = other.ToMap(entityManager);
-
-            return ExamineSystemShared.InRangeUnOccluded(origin, otherPosition, range, predicate,
-                ignoreInsideBlocker);
-        }
-
-        public static bool InRangeUnOccluded(
-            this MapCoordinates origin,
-            MapCoordinates other,
-            float range = InteractionRange,
-            Ignored? predicate = null,
-            bool ignoreInsideBlocker = true)
-        {
-            return ExamineSystemShared.InRangeUnOccluded(origin, other, range, predicate,
-                ignoreInsideBlocker);
-        }
-        #endregion
-    }
-}