diff --git a/Robust.UnitTesting/Server/GameObjects/ComponentMapInitTest.cs b/Robust.UnitTesting/Server/GameObjects/ComponentMapInitTest.cs index 25ed08d68..56ca5abc3 100644 --- a/Robust.UnitTesting/Server/GameObjects/ComponentMapInitTest.cs +++ b/Robust.UnitTesting/Server/GameObjects/ComponentMapInitTest.cs @@ -26,8 +26,8 @@ public sealed partial class ComponentMapInitTest var sim = simFactory.InitializeInstance(); var entManager = sim.Resolve(); - var mapManager = sim.Resolve(); - sim.Resolve().System().CreateMap(out var mapId); + var mapSystem = entManager.System(); + mapSystem.CreateMap(out var mapId); var ent = entManager.SpawnEntity(null, new MapCoordinates(Vector2.Zero, mapId)); Assert.That(entManager.GetComponent(ent).EntityLifeStage, Is.EqualTo(EntityLifeStage.MapInitialized)); @@ -36,7 +36,7 @@ public sealed partial class ComponentMapInitTest Assert.That(comp.Count, Is.EqualTo(1)); - mapManager.DeleteMap(mapId); + mapSystem.DeleteMap(mapId); } [Reflect(false)] diff --git a/Robust.UnitTesting/Shared/GameObjects/IEntityManagerTests.cs b/Robust.UnitTesting/Shared/GameObjects/IEntityManagerTests.cs index 5601356ab..d168c7fe1 100644 --- a/Robust.UnitTesting/Shared/GameObjects/IEntityManagerTests.cs +++ b/Robust.UnitTesting/Shared/GameObjects/IEntityManagerTests.cs @@ -39,13 +39,13 @@ namespace Robust.UnitTesting.Shared.GameObjects var sim = RobustServerSimulation.NewSimulation().InitializeInstance(); var entManager = sim.Resolve(); - var mapManager = sim.Resolve(); + var mapSystem = entManager.System(); Assert.That(entManager.Count(), Is.EqualTo(0)); var mapId = sim.CreateMap().MapId; Assert.That(entManager.Count(), Is.EqualTo(1)); - mapManager.DeleteMap(mapId); + mapSystem.DeleteMap(mapId); Assert.That(entManager.Count(), Is.EqualTo(0)); } } diff --git a/Robust.UnitTesting/Shared/Map/GridSplit_Tests.cs b/Robust.UnitTesting/Shared/Map/GridSplit_Tests.cs index 846ae261e..4e946944d 100644 --- a/Robust.UnitTesting/Shared/Map/GridSplit_Tests.cs +++ b/Robust.UnitTesting/Shared/Map/GridSplit_Tests.cs @@ -53,7 +53,7 @@ public sealed class GridSplit_Tests mapSystem.SetTile(gridEnt, new Vector2i(2, 0), Tile.Empty); Assert.That(mapManager.GetAllGrids(mapId).Count(), Is.EqualTo(2)); - mapManager.DeleteMap(mapId); + mapSystem.DeleteMap(mapId); } [Test] @@ -75,7 +75,7 @@ public sealed class GridSplit_Tests mapSystem.SetTile(gridEnt, new Vector2i(1, 0), Tile.Empty); Assert.That(mapManager.GetAllGrids(mapId).Count(), Is.EqualTo(2)); - mapManager.DeleteMap(mapId); + mapSystem.DeleteMap(mapId); } [Test] @@ -106,7 +106,7 @@ public sealed class GridSplit_Tests mapSystem.SetTile(gridEnt, new Vector2i(1, 0), Tile.Empty); Assert.That(mapManager.GetAllGrids(mapId).Count(), Is.EqualTo(2)); - mapManager.DeleteMap(mapId); + mapSystem.DeleteMap(mapId); } [Test] @@ -130,7 +130,7 @@ public sealed class GridSplit_Tests mapSystem.SetTile(gridEnt, new Vector2i(1, 0), Tile.Empty); Assert.That(mapManager.GetAllGrids(mapId).Count(), Is.EqualTo(3)); - mapManager.DeleteMap(mapId); + mapSystem.DeleteMap(mapId); } /// @@ -181,6 +181,6 @@ public sealed class GridSplit_Tests Assert.That(dummyXform.GridUid, Is.EqualTo(newGrid.Owner)); Assert.That(newGridXform._children, Does.Contain(dummy)); }); - mapManager.DeleteMap(mapId); + mapSystem.DeleteMap(mapId); } } diff --git a/Robust.UnitTesting/Shared/Map/MapGridMap_Tests.cs b/Robust.UnitTesting/Shared/Map/MapGridMap_Tests.cs index 9c7743d51..d6fbc45fe 100644 --- a/Robust.UnitTesting/Shared/Map/MapGridMap_Tests.cs +++ b/Robust.UnitTesting/Shared/Map/MapGridMap_Tests.cs @@ -39,6 +39,7 @@ public sealed class MapGridMap_Tests var entManager = sim.Resolve(); var mapManager = sim.Resolve(); + var mapSystem = entManager.System(); var mapId = sim.CreateMap().MapId; mapManager.CreateGridEntity(mapId); @@ -49,6 +50,6 @@ public sealed class MapGridMap_Tests entManager.TickUpdate(0.016f, false); }); - mapManager.DeleteMap(mapId); + mapSystem.DeleteMap(mapId); } } diff --git a/Robust.UnitTesting/Shared/Physics/Fixtures_Test.cs b/Robust.UnitTesting/Shared/Physics/Fixtures_Test.cs index 9c25a17c5..81b8d0e65 100644 --- a/Robust.UnitTesting/Shared/Physics/Fixtures_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/Fixtures_Test.cs @@ -20,10 +20,10 @@ public sealed class Fixtures_Test var sim = RobustServerSimulation.NewSimulation().InitializeInstance(); var entManager = sim.Resolve(); - var mapManager = sim.Resolve(); var sysManager = sim.Resolve(); var fixturesSystem = sysManager.GetEntitySystem(); var physicsSystem = sysManager.GetEntitySystem(); + var mapSystem = sysManager.GetEntitySystem(); var map = sim.CreateMap().MapId; var ent = sim.SpawnEntity(null, new MapCoordinates(Vector2.Zero, map)); @@ -36,6 +36,6 @@ public sealed class Fixtures_Test Assert.That(fixture.Density, Is.EqualTo(10f)); Assert.That(body.Mass, Is.EqualTo(10f)); - mapManager.DeleteMap(map); + mapSystem.DeleteMap(map); } } diff --git a/Robust.UnitTesting/Shared/Physics/Joints_Test.cs b/Robust.UnitTesting/Shared/Physics/Joints_Test.cs index cd68b31bf..0f5c72814 100644 --- a/Robust.UnitTesting/Shared/Physics/Joints_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/Joints_Test.cs @@ -24,8 +24,8 @@ public sealed class Joints_Test var sim = factory.InitializeInstance(); var entManager = sim.Resolve(); - var mapManager = sim.Resolve(); var jointSystem = entManager.System(); + var mapSystem = entManager.System(); var mapId = sim.CreateMap().MapId; @@ -53,7 +53,7 @@ public sealed class Joints_Test Assert.That(entManager.GetComponent(uidC).Relayed, Is.Empty); Assert.That(entManager.GetComponent(uidA).Relay, Is.EqualTo(null)); }); - mapManager.DeleteMap(mapId); + mapSystem.DeleteMap(mapId); } /// @@ -65,11 +65,11 @@ public sealed class Joints_Test var factory = RobustServerSimulation.NewSimulation(); var server = factory.InitializeInstance(); var entManager = server.Resolve(); - var mapManager = server.Resolve(); var fixtureSystem = entManager.EntitySysManager.GetEntitySystem(); var jointSystem = entManager.EntitySysManager.GetEntitySystem(); var broadphaseSystem = entManager.EntitySysManager.GetEntitySystem(); var physicsSystem = server.Resolve().GetEntitySystem(); + var mapSystem = entManager.System(); var mapId = server.CreateMap().MapId; @@ -106,6 +106,6 @@ public sealed class Joints_Test broadphaseSystem.FindNewContacts(mapId); Assert.That(body1.Contacts, Has.Count.EqualTo(1)); - mapManager.DeleteMap(mapId); + mapSystem.DeleteMap(mapId); } } diff --git a/Robust.UnitTesting/Shared/Spawning/EntitySpawnHelpersTest.cs b/Robust.UnitTesting/Shared/Spawning/EntitySpawnHelpersTest.cs index f2f3d952d..0e990bfab 100644 --- a/Robust.UnitTesting/Shared/Spawning/EntitySpawnHelpersTest.cs +++ b/Robust.UnitTesting/Shared/Spawning/EntitySpawnHelpersTest.cs @@ -20,10 +20,13 @@ public abstract partial class EntitySpawnHelpersTest : RobustIntegrationTest { protected ServerIntegrationInstance Server = default!; protected IEntityManager EntMan = default!; - protected IMapManager MapMan = default!; + protected SharedMapSystem MapSys = default!; protected SharedTransformSystem Xforms = default!; protected SharedContainerSystem Container = default!; + // Even if unused, content / downstream tests might use this class, so removal would be a breaking change? + protected IMapManager MapMan = default!; + protected EntityUid Map; protected MapId MapId; protected EntityUid Parent; // entity parented to the map. @@ -43,6 +46,7 @@ public abstract partial class EntitySpawnHelpersTest : RobustIntegrationTest await Server.WaitIdleAsync(); MapMan = Server.ResolveDependency(); EntMan = Server.ResolveDependency(); + MapSys = EntMan.System(); Xforms = EntMan.System(); Container = EntMan.System(); diff --git a/Robust.UnitTesting/Shared/Spawning/SpawnInContainerOrDropTest.cs b/Robust.UnitTesting/Shared/Spawning/SpawnInContainerOrDropTest.cs index e2b12d3a3..08c5caff5 100644 --- a/Robust.UnitTesting/Shared/Spawning/SpawnInContainerOrDropTest.cs +++ b/Robust.UnitTesting/Shared/Spawning/SpawnInContainerOrDropTest.cs @@ -116,7 +116,7 @@ public sealed class SpawnInContainerOrDropTest : EntitySpawnHelpersTest Assert.That(xform.GridUid, Is.Null); }); - await Server.WaitPost(() =>MapMan.DeleteMap(MapId)); + await Server.WaitPost(() => MapSys.DeleteMap(MapId)); Server.Dispose(); } } diff --git a/Robust.UnitTesting/Shared/Spawning/SpawnNextToOrDropTest.cs b/Robust.UnitTesting/Shared/Spawning/SpawnNextToOrDropTest.cs index 67c3d3fe7..738dfb028 100644 --- a/Robust.UnitTesting/Shared/Spawning/SpawnNextToOrDropTest.cs +++ b/Robust.UnitTesting/Shared/Spawning/SpawnNextToOrDropTest.cs @@ -121,7 +121,7 @@ public sealed class SpawnNextToOrDropTest : EntitySpawnHelpersTest Assert.That(EntMan.GetComponent(uid).EntityLifeStage, Is.LessThan(EntityLifeStage.MapInitialized)); }); - await Server.WaitPost(() =>MapMan.DeleteMap(MapId)); + await Server.WaitPost(() => MapSys.DeleteMap(MapId)); Server.Dispose(); } } diff --git a/Robust.UnitTesting/Shared/Spawning/TrySpawnInContainerTest.cs b/Robust.UnitTesting/Shared/Spawning/TrySpawnInContainerTest.cs index 2e8ea75fd..b817345fe 100644 --- a/Robust.UnitTesting/Shared/Spawning/TrySpawnInContainerTest.cs +++ b/Robust.UnitTesting/Shared/Spawning/TrySpawnInContainerTest.cs @@ -42,7 +42,7 @@ public sealed class TrySpawnInContainerTest : EntitySpawnHelpersTest Assert.That(EntMan.EntityExists(uid), Is.False); }); - await Server.WaitPost(() =>MapMan.DeleteMap(MapId)); + await Server.WaitPost(() => MapSys.DeleteMap(MapId)); Server.Dispose(); } } diff --git a/Robust.UnitTesting/Shared/Spawning/TrySpawnNextToTest.cs b/Robust.UnitTesting/Shared/Spawning/TrySpawnNextToTest.cs index 765b9233f..b464f03e0 100644 --- a/Robust.UnitTesting/Shared/Spawning/TrySpawnNextToTest.cs +++ b/Robust.UnitTesting/Shared/Spawning/TrySpawnNextToTest.cs @@ -50,7 +50,7 @@ public sealed class TrySpawnNextToTest : EntitySpawnHelpersTest Assert.That(EntMan.EntityExists(uid), Is.False); }); - await Server.WaitPost(() =>MapMan.DeleteMap(MapId)); + await Server.WaitPost(() => MapSys.DeleteMap(MapId)); Server.Dispose(); } }