]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Cleanup TabletopSystem.Map (#36097)
authorTayrtahn <tayrtahn@gmail.com>
Wed, 26 Mar 2025 14:17:28 +0000 (10:17 -0400)
committerGitHub <noreply@github.com>
Wed, 26 Mar 2025 14:17:28 +0000 (15:17 +0100)
* Add SharedMapSystem dependency

* IMapManager.MapExists -> SharedMapSystem.MapExists

* IMapManager.CreateMap & IMapManager.GetMapEntityId -> SharedMapSystem.CreateMap

* IMapManager.DeleteMap -> SharedMapSystem.DeleteMap

* Remove IMapManager dependency

Content.Server/Tabletop/TabletopSystem.Map.cs
Content.Server/Tabletop/TabletopSystem.cs

index 362fbc5550c1ee5e10190f8fef2024d0e7dd9e07..837ab2df24c8d87f10c80c0098cf0c8c91b18de9 100644 (file)
@@ -45,12 +45,12 @@ namespace Content.Server.Tabletop
         /// </summary>
         private void EnsureTabletopMap()
         {
-            if (TabletopMap != MapId.Nullspace && _mapManager.MapExists(TabletopMap))
+            if (TabletopMap != MapId.Nullspace && _map.MapExists(TabletopMap))
                 return;
 
-            TabletopMap = _mapManager.CreateMap();
+            var mapUid = _map.CreateMap(out var mapId);
+            TabletopMap = mapId;
             _tabletops = 0;
-            var mapUid = _mapManager.GetMapEntityId(TabletopMap);
 
             var mapComp = EntityManager.GetComponent<MapComponent>(mapUid);
 
@@ -89,11 +89,11 @@ namespace Content.Server.Tabletop
 
         private void OnRoundRestart(RoundRestartCleanupEvent _)
         {
-            if (TabletopMap == MapId.Nullspace || !_mapManager.MapExists(TabletopMap))
+            if (TabletopMap == MapId.Nullspace || !_map.MapExists(TabletopMap))
                 return;
 
             // This will usually *not* be the case, but better make sure.
-            _mapManager.DeleteMap(TabletopMap);
+            _map.DeleteMap(TabletopMap);
 
             // Reset tabletop count.
             _tabletops = 0;
index f152648e21434a1058de4f411bbe20911e835f52..6938372233cb2d6b665bc9b3ee879dd2a20dcdf8 100644 (file)
@@ -12,7 +12,6 @@ using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Robust.Shared.Configuration;
 using Robust.Shared.Enums;
-using Robust.Shared.Map;
 using Robust.Shared.Player;
 using Robust.Shared.Utility;
 
@@ -21,7 +20,7 @@ namespace Content.Server.Tabletop
     [UsedImplicitly]
     public sealed partial class TabletopSystem : SharedTabletopSystem
     {
-        [Dependency] private readonly IMapManager _mapManager = default!;
+        [Dependency] private readonly SharedMapSystem _map = default!;
         [Dependency] private readonly EyeSystem _eye = default!;
         [Dependency] private readonly ViewSubscriberSystem _viewSubscriberSystem = default!;
         [Dependency] private readonly PopupSystem _popupSystem = default!;