]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Change PlaceableSurfaceSystem.cs to file scoped namespace (#28379)
authorShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
Wed, 29 May 2024 12:56:14 +0000 (05:56 -0700)
committerGitHub <noreply@github.com>
Wed, 29 May 2024 12:56:14 +0000 (08:56 -0400)
Content.Shared/Placeable/PlaceableSurfaceSystem.cs

index b0031cfa33f24c6d03a2ae69d41241ee126d69fd..a9a9390a6e0e9838ad9d3d01ac4b62ab721b1e52 100644 (file)
@@ -3,68 +3,67 @@ using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Interaction;
 using Content.Shared.Storage.Components;
 
-namespace Content.Shared.Placeable
+namespace Content.Shared.Placeable;
+
+public sealed class PlaceableSurfaceSystem : EntitySystem
 {
-    public sealed class PlaceableSurfaceSystem : EntitySystem
-    {
-        [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
+    [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
 
-        public override void Initialize()
-        {
-            base.Initialize();
+    public override void Initialize()
+    {
+        base.Initialize();
 
-            SubscribeLocalEvent<PlaceableSurfaceComponent, AfterInteractUsingEvent>(OnAfterInteractUsing);
-        }
+        SubscribeLocalEvent<PlaceableSurfaceComponent, AfterInteractUsingEvent>(OnAfterInteractUsing);
+    }
 
-        public void SetPlaceable(EntityUid uid, bool isPlaceable, PlaceableSurfaceComponent? surface = null)
-        {
-            if (!Resolve(uid, ref surface, false))
-                return;
+    public void SetPlaceable(EntityUid uid, bool isPlaceable, PlaceableSurfaceComponent? surface = null)
+    {
+        if (!Resolve(uid, ref surface, false))
+            return;
 
-            surface.IsPlaceable = isPlaceable;
-            Dirty(uid, surface);
-        }
+        surface.IsPlaceable = isPlaceable;
+        Dirty(uid, surface);
+    }
 
-        public void SetPlaceCentered(EntityUid uid, bool placeCentered, PlaceableSurfaceComponent? surface = null)
-        {
-            if (!Resolve(uid, ref surface))
-                return;
+    public void SetPlaceCentered(EntityUid uid, bool placeCentered, PlaceableSurfaceComponent? surface = null)
+    {
+        if (!Resolve(uid, ref surface))
+            return;
 
-            surface.PlaceCentered = placeCentered;
-            Dirty(uid, surface);
-        }
+        surface.PlaceCentered = placeCentered;
+        Dirty(uid, surface);
+    }
 
-        public void SetPositionOffset(EntityUid uid, Vector2 offset, PlaceableSurfaceComponent? surface = null)
-        {
-            if (!Resolve(uid, ref surface))
-                return;
+    public void SetPositionOffset(EntityUid uid, Vector2 offset, PlaceableSurfaceComponent? surface = null)
+    {
+        if (!Resolve(uid, ref surface))
+            return;
 
-            surface.PositionOffset = offset;
-            Dirty(uid, surface);
-        }
+        surface.PositionOffset = offset;
+        Dirty(uid, surface);
+    }
 
-        private void OnAfterInteractUsing(EntityUid uid, PlaceableSurfaceComponent surface, AfterInteractUsingEvent args)
-        {
-            if (args.Handled || !args.CanReach)
-                return;
+    private void OnAfterInteractUsing(EntityUid uid, PlaceableSurfaceComponent surface, AfterInteractUsingEvent args)
+    {
+        if (args.Handled || !args.CanReach)
+            return;
 
-            if (!surface.IsPlaceable)
-                return;
+        if (!surface.IsPlaceable)
+            return;
 
-            // 99% of the time they want to dump the stuff inside on the table, they can manually place with q if they really need to.
-            // Just causes prediction CBT otherwise.
-            if (HasComp<DumpableComponent>(args.Used))
-                return;
+        // 99% of the time they want to dump the stuff inside on the table, they can manually place with q if they really need to.
+        // Just causes prediction CBT otherwise.
+        if (HasComp<DumpableComponent>(args.Used))
+            return;
 
-            if (!_handsSystem.TryDrop(args.User, args.Used))
-                return;
+        if (!_handsSystem.TryDrop(args.User, args.Used))
+            return;
 
-            if (surface.PlaceCentered)
-                Transform(args.Used).LocalPosition = Transform(uid).LocalPosition + surface.PositionOffset;
-            else
-                Transform(args.Used).Coordinates = args.ClickLocation;
+        if (surface.PlaceCentered)
+            Transform(args.Used).LocalPosition = Transform(uid).LocalPosition + surface.PositionOffset;
+        else
+            Transform(args.Used).Coordinates = args.ClickLocation;
 
-            args.Handled = true;
-        }
+        args.Handled = true;
     }
 }