diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs index 644ef8af35..0d5b11890f 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs @@ -9,6 +9,7 @@ using Robust.Client.UserInterface.CustomControls; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Client.Administration.UI.Tabs.AtmosTab { @@ -16,7 +17,7 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab [UsedImplicitly] public sealed partial class AddAtmosWindow : DefaultWindow { - private IEnumerable? _data; + private IEnumerable? _data; protected override void EnteredTree() { diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs index 92c079f6b4..913992b11a 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs @@ -11,6 +11,7 @@ using Robust.Client.UserInterface.CustomControls; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Client.Administration.UI.Tabs.AtmosTab { @@ -18,7 +19,7 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab [UsedImplicitly] public sealed partial class AddGasWindow : DefaultWindow { - private IEnumerable? _gridData; + private IEnumerable? _gridData; private IEnumerable? _gasData; protected override void EnteredTree() diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs index 35a0ea99db..ccc1a9955c 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs @@ -11,6 +11,7 @@ using Robust.Client.UserInterface.CustomControls; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Client.Administration.UI.Tabs.AtmosTab { @@ -18,7 +19,7 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab [UsedImplicitly] public sealed partial class FillGasWindow : DefaultWindow { - private IEnumerable? _gridData; + private IEnumerable? _gridData; private IEnumerable? _gasData; protected override void EnteredTree() diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/SetTemperatureWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/SetTemperatureWindow.xaml.cs index 6ff73c979b..274990b96e 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/SetTemperatureWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/SetTemperatureWindow.xaml.cs @@ -9,6 +9,7 @@ using Robust.Client.UserInterface.CustomControls; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Client.Administration.UI.Tabs.AtmosTab { @@ -16,7 +17,7 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab [UsedImplicitly] public sealed partial class SetTemperatureWindow : DefaultWindow { - private IEnumerable? _data; + private IEnumerable? _data; protected override void EnteredTree() { diff --git a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs index 53c3fe8d0b..1536ba6760 100644 --- a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs @@ -4,6 +4,7 @@ using Robust.Client.AutoGenerated; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; +using Robust.Shared.Map.Components; namespace Content.Client.Administration.UI.Tabs.ObjectsTab; diff --git a/Content.Client/IconSmoothing/IconSmoothSystem.cs b/Content.Client/IconSmoothing/IconSmoothSystem.cs index d40cdd7568..d1cc36becd 100644 --- a/Content.Client/IconSmoothing/IconSmoothSystem.cs +++ b/Content.Client/IconSmoothing/IconSmoothSystem.cs @@ -1,6 +1,7 @@ using JetBrains.Annotations; using Robust.Client.GameObjects; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using static Robust.Client.GameObjects.SpriteComponent; namespace Content.Client.IconSmoothing @@ -185,7 +186,7 @@ namespace Content.Client.IconSmoothing var xform = xformQuery.GetComponent(uid); - IMapGrid? grid = null; + MapGridComponent? grid = null; if (xform.Anchored) { @@ -209,7 +210,7 @@ namespace Content.Client.IconSmoothing } } - private void CalculateNewSpriteCardinal(IMapGrid? grid, IconSmoothComponent smooth, SpriteComponent sprite, TransformComponent xform, EntityQuery smoothQuery) + private void CalculateNewSpriteCardinal(MapGridComponent? grid, IconSmoothComponent smooth, SpriteComponent sprite, TransformComponent xform, EntityQuery smoothQuery) { var dirs = CardinalConnectDirs.None; @@ -243,7 +244,7 @@ namespace Content.Client.IconSmoothing return false; } - private void CalculateNewSpriteCorners(IMapGrid? grid, IconSmoothComponent smooth, SpriteComponent sprite, TransformComponent xform, EntityQuery smoothQuery) + private void CalculateNewSpriteCorners(MapGridComponent? grid, IconSmoothComponent smooth, SpriteComponent sprite, TransformComponent xform, EntityQuery smoothQuery) { var (cornerNE, cornerNW, cornerSW, cornerSE) = grid == null ? (CornerFill.None, CornerFill.None, CornerFill.None, CornerFill.None) @@ -260,7 +261,7 @@ namespace Content.Client.IconSmoothing sprite.LayerSetState(CornerLayers.NW, $"{smooth.StateBase}{(int) cornerNW}"); } - private (CornerFill ne, CornerFill nw, CornerFill sw, CornerFill se) CalculateCornerFill(IMapGrid grid, IconSmoothComponent smooth, TransformComponent xform, EntityQuery smoothQuery) + private (CornerFill ne, CornerFill nw, CornerFill sw, CornerFill se) CalculateCornerFill(MapGridComponent grid, IconSmoothComponent smooth, TransformComponent xform, EntityQuery smoothQuery) { var pos = grid.TileIndicesFor(xform.Coordinates); var n = MatchingEntity(smooth, grid.GetAnchoredEntities(pos.Offset(Direction.North)), smoothQuery); diff --git a/Content.IntegrationTests/PoolManager.cs b/Content.IntegrationTests/PoolManager.cs index 804140602a..ea62153bd0 100644 --- a/Content.IntegrationTests/PoolManager.cs +++ b/Content.IntegrationTests/PoolManager.cs @@ -23,6 +23,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Network; using Robust.Shared.Prototypes; using Robust.Shared.Timing; @@ -752,7 +753,7 @@ public sealed class PoolSettings public sealed class TestMapData { public MapId MapId { get; set; } - public IMapGrid MapGrid { get; set; } + public MapGridComponent MapGrid { get; set; } public EntityCoordinates GridCoords { get; set; } public MapCoordinates MapCoords { get; set; } public TileRef Tile { get; set; } diff --git a/Content.IntegrationTests/Tests/DeviceNetwork/DeviceNetworkTest.cs b/Content.IntegrationTests/Tests/DeviceNetwork/DeviceNetworkTest.cs index 7484b1b55b..4d8a741e73 100644 --- a/Content.IntegrationTests/Tests/DeviceNetwork/DeviceNetworkTest.cs +++ b/Content.IntegrationTests/Tests/DeviceNetwork/DeviceNetworkTest.cs @@ -6,6 +6,7 @@ using NUnit.Framework; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.IntegrationTests.Tests.DeviceNetwork { @@ -189,7 +190,7 @@ namespace Content.IntegrationTests.Tests.DeviceNetwork DeviceNetworkComponent networkComponent1 = null; DeviceNetworkComponent networkComponent2 = null; WiredNetworkComponent wiredNetworkComponent = null; - IMapGrid grid = testMap.MapGrid; + MapGridComponent grid = testMap.MapGrid; var testValue = "test"; var payload = new NetworkPayload diff --git a/Content.IntegrationTests/Tests/EntityTest.cs b/Content.IntegrationTests/Tests/EntityTest.cs index 2030e5e933..5ca88a790c 100644 --- a/Content.IntegrationTests/Tests/EntityTest.cs +++ b/Content.IntegrationTests/Tests/EntityTest.cs @@ -9,6 +9,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Maths; using Robust.Shared.Prototypes; @@ -129,7 +130,7 @@ namespace Content.IntegrationTests.Tests var componentFactory = server.ResolveDependency(); var tileDefinitionManager = server.ResolveDependency(); - IMapGrid grid = default; + MapGridComponent grid = default; await server.WaitPost(() => { @@ -224,7 +225,7 @@ namespace Content.IntegrationTests.Tests var componentFactory = server.ResolveDependency(); var tileDefinitionManager = server.ResolveDependency(); - IMapGrid grid = default; + MapGridComponent grid = default; await server.WaitPost(() => { diff --git a/Content.IntegrationTests/Tests/Fluids/FluidSpillTest.cs b/Content.IntegrationTests/Tests/Fluids/FluidSpillTest.cs index a99924562d..afa8c9c2e6 100644 --- a/Content.IntegrationTests/Tests/Fluids/FluidSpillTest.cs +++ b/Content.IntegrationTests/Tests/Fluids/FluidSpillTest.cs @@ -9,6 +9,7 @@ using Content.Shared.FixedPoint; using NUnit.Framework; using Robust.Shared.GameObjects; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Maths; using Robust.Shared.Timing; @@ -18,7 +19,7 @@ namespace Content.IntegrationTests.Tests.Fluids; [TestOf(typeof(FluidSpreaderSystem))] public sealed class FluidSpill { - private static PuddleComponent? GetPuddle(IEntityManager entityManager, IMapGrid mapGrid, Vector2i pos) + private static PuddleComponent? GetPuddle(IEntityManager entityManager, MapGridComponent mapGrid, Vector2i pos) { foreach (var uid in mapGrid.GetAnchoredEntities(pos)) { diff --git a/Content.IntegrationTests/Tests/Fluids/PuddleTest.cs b/Content.IntegrationTests/Tests/Fluids/PuddleTest.cs index c7c7882a27..658da4796b 100644 --- a/Content.IntegrationTests/Tests/Fluids/PuddleTest.cs +++ b/Content.IntegrationTests/Tests/Fluids/PuddleTest.cs @@ -8,6 +8,7 @@ using Content.Shared.FixedPoint; using NUnit.Framework; using Robust.Shared.GameObjects; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Timing; namespace Content.IntegrationTests.Tests.Fluids @@ -54,7 +55,7 @@ namespace Content.IntegrationTests.Tests.Fluids var entitySystemManager = server.ResolveDependency(); var spillSystem = entitySystemManager.GetEntitySystem(); - IMapGrid grid = null; + MapGridComponent grid = null; // Remove all tiles await server.WaitPost(() => @@ -93,7 +94,7 @@ namespace Content.IntegrationTests.Tests.Fluids var metaSystem = entityManager.EntitySysManager.GetEntitySystem(); MapId sMapId = default; - IMapGrid sGrid; + MapGridComponent sGrid; EntityUid sGridId = default; EntityCoordinates sCoordinates = default; diff --git a/Content.IntegrationTests/Tests/GravityGridTest.cs b/Content.IntegrationTests/Tests/GravityGridTest.cs index d803118ec2..b0434d9db6 100644 --- a/Content.IntegrationTests/Tests/GravityGridTest.cs +++ b/Content.IntegrationTests/Tests/GravityGridTest.cs @@ -7,6 +7,7 @@ using NUnit.Framework; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.IntegrationTests.Tests { @@ -38,8 +39,8 @@ namespace Content.IntegrationTests.Tests EntityUid generator = default; var entityMan = server.ResolveDependency(); - IMapGrid grid1 = null; - IMapGrid grid2 = null; + MapGridComponent grid1 = null; + MapGridComponent grid2 = null; // Create grids await server.WaitAssertion(() => diff --git a/Content.IntegrationTests/Tests/PrototypeSaveTest.cs b/Content.IntegrationTests/Tests/PrototypeSaveTest.cs index 64e8441fdf..50148a54db 100644 --- a/Content.IntegrationTests/Tests/PrototypeSaveTest.cs +++ b/Content.IntegrationTests/Tests/PrototypeSaveTest.cs @@ -8,6 +8,7 @@ using NUnit.Framework; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Physics; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.Manager; @@ -87,7 +88,7 @@ public sealed class PrototypeSaveTest var compFact = server.ResolveDependency(); var prototypes = new List(); - IMapGrid grid = default!; + MapGridComponent grid = default!; EntityUid uid; MapId mapId = default; diff --git a/Content.MapRenderer/Painters/GridPainter.cs b/Content.MapRenderer/Painters/GridPainter.cs index 7cd9999639..7a3905ad2a 100644 --- a/Content.MapRenderer/Painters/GridPainter.cs +++ b/Content.MapRenderer/Painters/GridPainter.cs @@ -6,6 +6,7 @@ using Content.Shared.Decals; using Robust.Client.GameObjects; using Robust.Shared.GameObjects; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Maths; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -43,7 +44,7 @@ namespace Content.MapRenderer.Painters _decals = GetDecals(); } - public void Run(Image gridCanvas, IMapGrid grid) + public void Run(Image gridCanvas, MapGridComponent grid) { var stopwatch = new Stopwatch(); stopwatch.Start(); @@ -136,7 +137,7 @@ namespace Content.MapRenderer.Painters return decals; } - private (float x, float y) TransformLocalPosition(Vector2 position, IMapGrid grid) + private (float x, float y) TransformLocalPosition(Vector2 position, MapGridComponent grid) { var xOffset = (int) -grid.LocalAABB.Left; var yOffset = (int) -grid.LocalAABB.Bottom; diff --git a/Content.MapRenderer/Painters/MapPainter.cs b/Content.MapRenderer/Painters/MapPainter.cs index 823c57e0af..84383f9551 100644 --- a/Content.MapRenderer/Painters/MapPainter.cs +++ b/Content.MapRenderer/Painters/MapPainter.cs @@ -9,6 +9,7 @@ using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.GameObjects; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Maths; using Robust.Shared.Timing; using SixLabors.ImageSharp; @@ -59,7 +60,7 @@ namespace Content.MapRenderer.Painters var tilePainter = new TilePainter(client, server); var entityPainter = new GridPainter(client, server); - IMapGrid[] grids = null!; + MapGridComponent[] grids = null!; var xformQuery = sEntityManager.GetEntityQuery(); await server.WaitPost(() => diff --git a/Content.MapRenderer/Painters/TilePainter.cs b/Content.MapRenderer/Painters/TilePainter.cs index 1d01533dee..09bfd53103 100644 --- a/Content.MapRenderer/Painters/TilePainter.cs +++ b/Content.MapRenderer/Painters/TilePainter.cs @@ -4,6 +4,7 @@ using System.Linq; using Robust.Client.Graphics; using Robust.Client.ResourceManagement; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Timing; using SixLabors.ImageSharp; using SixLabors.ImageSharp.PixelFormats; @@ -26,7 +27,7 @@ namespace Content.MapRenderer.Painters _cResourceCache = client.ResolveDependency(); } - public void Run(Image gridCanvas, IMapGrid grid) + public void Run(Image gridCanvas, MapGridComponent grid) { var stopwatch = new Stopwatch(); stopwatch.Start(); diff --git a/Content.Server/AME/AMENodeGroup.cs b/Content.Server/AME/AMENodeGroup.cs index 83af931630..ba23adb9e7 100644 --- a/Content.Server/AME/AMENodeGroup.cs +++ b/Content.Server/AME/AMENodeGroup.cs @@ -4,6 +4,7 @@ using Content.Server.Explosion.EntitySystems; using Content.Server.NodeContainer.NodeGroups; using Content.Server.NodeContainer.Nodes; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Random; namespace Content.Server.AME @@ -37,7 +38,7 @@ namespace Content.Server.AME base.LoadNodes(groupNodes); var mapManager = IoCManager.Resolve(); - IMapGrid? grid = null; + MapGridComponent? grid = null; foreach (var node in groupNodes) { diff --git a/Content.Server/Administration/Commands/VariantizeCommand.cs b/Content.Server/Administration/Commands/VariantizeCommand.cs index d0e5d65297..669ff637b8 100644 --- a/Content.Server/Administration/Commands/VariantizeCommand.cs +++ b/Content.Server/Administration/Commands/VariantizeCommand.cs @@ -2,6 +2,7 @@ using Content.Shared.Maps; using Robust.Shared.Console; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Random; namespace Content.Server.Administration.Commands; @@ -38,11 +39,11 @@ public sealed class VariantizeCommand : IConsoleCommand return; } - foreach (var tile in gridComp.Grid.GetAllTiles()) + foreach (var tile in gridComp.GetAllTiles()) { var def = tile.GetContentTileDefinition(); var newTile = new Tile(tile.Tile.TypeId, tile.Tile.Flags, random.Pick(def.PlacementVariants)); - gridComp.Grid.SetTile(tile.GridIndices, newTile); + gridComp.SetTile(tile.GridIndices, newTile); } } } diff --git a/Content.Server/Administration/Systems/AdminTestArenaSystem.cs b/Content.Server/Administration/Systems/AdminTestArenaSystem.cs index 5640c580fb..181c1a623d 100644 --- a/Content.Server/Administration/Systems/AdminTestArenaSystem.cs +++ b/Content.Server/Administration/Systems/AdminTestArenaSystem.cs @@ -1,6 +1,7 @@ using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Network; namespace Content.Server.Administration.Systems; diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs index 7aa33a6108..1dcda84dac 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs @@ -45,6 +45,7 @@ using Content.Shared.Tabletop.Components; using Content.Shared.Verbs; using Robust.Server.GameObjects; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Player; diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs index f720b77f4f..1a932a4a0e 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs @@ -30,6 +30,7 @@ using Content.Shared.Weapons.Ranged.Components; using Robust.Server.GameObjects; using Robust.Server.Physics; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Prototypes; diff --git a/Content.Server/Atmos/Commands/AddAtmosCommand.cs b/Content.Server/Atmos/Commands/AddAtmosCommand.cs index 1b5ba2aa96..7a13eef6d2 100644 --- a/Content.Server/Atmos/Commands/AddAtmosCommand.cs +++ b/Content.Server/Atmos/Commands/AddAtmosCommand.cs @@ -3,6 +3,7 @@ using Content.Server.Atmos.Components; using Content.Server.Atmos.EntitySystems; using Content.Shared.Administration; using Robust.Shared.Console; +using Robust.Shared.Map.Components; namespace Content.Server.Atmos.Commands { diff --git a/Content.Server/Atmos/Commands/AddGasCommand.cs b/Content.Server/Atmos/Commands/AddGasCommand.cs index 24bf32db97..2c4eb8785c 100644 --- a/Content.Server/Atmos/Commands/AddGasCommand.cs +++ b/Content.Server/Atmos/Commands/AddGasCommand.cs @@ -4,6 +4,7 @@ using Content.Shared.Administration; using Content.Shared.Atmos; using Robust.Shared.Console; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.Atmos.Commands { diff --git a/Content.Server/Atmos/EntitySystems/AirtightSystem.cs b/Content.Server/Atmos/EntitySystems/AirtightSystem.cs index fd166164f9..797619dec3 100644 --- a/Content.Server/Atmos/EntitySystems/AirtightSystem.cs +++ b/Content.Server/Atmos/EntitySystems/AirtightSystem.cs @@ -3,6 +3,7 @@ using Content.Server.Explosion.EntitySystems; using Content.Shared.Atmos; using JetBrains.Annotations; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.Atmos.EntitySystems { @@ -58,7 +59,7 @@ namespace Content.Server.Atmos.EntitySystems var gridId = xform.GridUid; var coords = xform.Coordinates; - var tilePos = grid.Grid.TileIndicesFor(coords); + var tilePos = grid.TileIndicesFor(coords); // Update and invalidate new position. airtight.LastPosition = (gridId.Value, tilePos); diff --git a/Content.Server/Atmos/EntitySystems/AtmosObstructionEnumerator.cs b/Content.Server/Atmos/EntitySystems/AtmosObstructionEnumerator.cs index 2a9d0729d6..aed009e9a1 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosObstructionEnumerator.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosObstructionEnumerator.cs @@ -1,6 +1,7 @@ using System.Diagnostics.CodeAnalysis; using Content.Server.Atmos.Components; using Robust.Shared.Map; +using Robust.Shared.Map.Enumerators; namespace Content.Server.Atmos.EntitySystems; diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs index cbef6b8ad9..a1a9e8844d 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.API.cs @@ -4,6 +4,7 @@ using Content.Server.Atmos.Reactions; using Content.Server.NodeContainer.NodeGroups; using Content.Shared.Atmos; using Robust.Server.GameObjects; +using Robust.Shared.Map.Components; using Robust.Shared.Utility; namespace Content.Server.Atmos.EntitySystems; diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs index c242e915e5..45fe16c4a6 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Commands.cs @@ -6,6 +6,7 @@ using Content.Shared.Atmos; using Content.Shared.Maps; using Robust.Shared.Console; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.Atmos.EntitySystems; @@ -100,7 +101,7 @@ public sealed partial class AtmosphereSystem tile.Clear(); var mixtureId = 0; - foreach (var entUid in gridComp.Grid.GetAnchoredEntities(indices)) + foreach (var entUid in gridComp.GetAnchoredEntities(indices)) { if (!TryComp(entUid, out AtmosFixMarkerComponent? afm)) continue; diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs index c70c5630ab..24ba93f3f4 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.GridAtmosphere.cs @@ -3,6 +3,7 @@ using Content.Server.Atmos.Components; using Content.Server.Atmos.Reactions; using Content.Shared.Atmos; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Utility; namespace Content.Server.Atmos.EntitySystems; @@ -53,7 +54,7 @@ public sealed partial class AtmosphereSystem tile.GridIndex = uid; } - GridRepopulateTiles(mapGrid.Grid, gridAtmosphere); + GridRepopulateTiles(mapGrid, gridAtmosphere); } private void OnGridSplit(EntityUid uid, GridAtmosphereComponent originalGridAtmos, ref GridSplitEvent args) @@ -230,7 +231,7 @@ public sealed partial class AtmosphereSystem var directions = AtmosDirection.Invalid; - var enumerator = GetObstructingComponentsEnumerator(mapGridComp.Grid, args.Tile); + var enumerator = GetObstructingComponentsEnumerator(mapGridComp, args.Tile); while (enumerator.MoveNext(out var obstructingComponent)) { @@ -332,7 +333,7 @@ public sealed partial class AtmosphereSystem return; tile.AdjacentBits = AtmosDirection.Invalid; - tile.BlockedAirflow = GetBlockedDirections(mapGridComp.Grid, tile.GridIndices); + tile.BlockedAirflow = GetBlockedDirections(mapGridComp, tile.GridIndices); for (var i = 0; i < Atmospherics.Directions; i++) { @@ -349,7 +350,7 @@ public sealed partial class AtmosphereSystem var oppositeDirection = direction.GetOpposite(); - adjacent.BlockedAirflow = GetBlockedDirections(mapGridComp.Grid, adjacent.GridIndices); + adjacent.BlockedAirflow = GetBlockedDirections(mapGridComp, adjacent.GridIndices); // Pass in MapGridComponent so we don't have to resolve it for every adjacent direction. var tileBlockedEv = new IsTileAirBlockedMethodEvent(uid, tile.GridIndices, direction, mapGridComp); @@ -456,7 +457,7 @@ public sealed partial class AtmosphereSystem tile.Air = new GasMixture { - Volume = GetVolumeForTiles(mapGridComp.Grid, 1), + Volume = GetVolumeForTiles(mapGridComp, 1), Temperature = Atmospherics.T20C }; @@ -533,7 +534,7 @@ public sealed partial class AtmosphereSystem /// /// The grid where to get all valid tiles from. /// The grid atmosphere where the tiles will be repopulated. - private void GridRepopulateTiles(IMapGrid mapGrid, GridAtmosphereComponent gridAtmosphere) + private void GridRepopulateTiles(MapGridComponent mapGrid, GridAtmosphereComponent gridAtmosphere) { var volume = GetVolumeForTiles(mapGrid, 1); diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs index 2b4978ccc3..b0ea868efc 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs @@ -8,6 +8,7 @@ using Robust.Shared.Physics.Components; using Robust.Shared.Random; using Robust.Shared.Utility; using System.Linq; +using Robust.Shared.Map.Components; namespace Content.Server.Atmos.EntitySystems { @@ -25,7 +26,7 @@ namespace Content.Server.Atmos.EntitySystems private readonly TileAtmosphere[] _depressurizeSpaceTiles = new TileAtmosphere[Atmospherics.MonstermosHardTileLimit]; private readonly TileAtmosphere[] _depressurizeProgressionOrder = new TileAtmosphere[Atmospherics.MonstermosHardTileLimit * 2]; - private void EqualizePressureInZone(IMapGrid mapGrid, GridAtmosphereComponent gridAtmosphere, TileAtmosphere tile, int cycleNum) + private void EqualizePressureInZone(MapGridComponent mapGrid, GridAtmosphereComponent gridAtmosphere, TileAtmosphere tile, int cycleNum) { if (tile.Air == null || (tile.MonstermosInfo.LastCycle >= cycleNum)) return; // Already done. @@ -354,7 +355,7 @@ namespace Content.Server.Atmos.EntitySystems Array.Clear(_equalizeQueue, 0, Atmospherics.MonstermosTileLimit); } - private void ExplosivelyDepressurize(IMapGrid mapGrid, GridAtmosphereComponent gridAtmosphere, TileAtmosphere tile, int cycleNum) + private void ExplosivelyDepressurize(MapGridComponent mapGrid, GridAtmosphereComponent gridAtmosphere, TileAtmosphere tile, int cycleNum) { // Check if explosive depressurization is enabled and if the tile is valid. if (!MonstermosDepressurization || tile.Air == null) @@ -603,7 +604,7 @@ namespace Content.Server.Atmos.EntitySystems adj.MonstermosInfo[direction.GetOpposite()] -= amount; } - private void HandleDecompressionFloorRip(IMapGrid mapGrid, TileAtmosphere tile, float sum) + private void HandleDecompressionFloorRip(MapGridComponent mapGrid, TileAtmosphere tile, float sum) { if (!MonstermosRipTiles) return; diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs index 59892beb28..0708ffe8ab 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs @@ -3,6 +3,7 @@ using Content.Server.Atmos.Piping.Components; using Content.Server.NodeContainer.NodeGroups; using Content.Shared.Atmos; using Content.Shared.Maps; +using Robust.Shared.Map.Components; using Robust.Shared.Physics.Components; using Robust.Shared.Timing; @@ -48,17 +49,16 @@ namespace Content.Server.Atmos.EntitySystems if (!TryComp(uid, out MapGridComponent? mapGridComp)) return true; - var mapGrid = mapGridComp.Grid; var mapUid = _mapManager.GetMapEntityIdOrThrow(Transform(mapGridComp.Owner).MapID); - var volume = GetVolumeForTiles(mapGrid, 1); + var volume = GetVolumeForTiles(mapGridComp, 1); var number = 0; while (atmosphere.CurrentRunInvalidatedCoordinates.TryDequeue(out var indices)) { if (!atmosphere.Tiles.TryGetValue(indices, out var tile)) { - tile = new TileAtmosphere(mapGrid.GridEntityId, indices, + tile = new TileAtmosphere(mapGridComp.GridEntityId, indices, new GasMixture(volume) { Temperature = Atmospherics.T20C }); atmosphere.Tiles[indices] = tile; } @@ -78,7 +78,7 @@ namespace Content.Server.Atmos.EntitySystems } // Call this instead of the grid method as the map has a say on whether the tile is space or not. - if ((!mapGrid.TryGetTileRef(indices, out var t) || t.IsSpace(_tileDefinitionManager)) && !isAirBlocked) + if ((!mapGridComp.TryGetTileRef(indices, out var t) || t.IsSpace(_tileDefinitionManager)) && !isAirBlocked) { tile.Air = GetTileMixture(null, mapUid, indices); tile.MolesArchived = tile.Air != null ? new float[Atmospherics.AdjustedNumberOfGases] : null; @@ -87,7 +87,7 @@ namespace Content.Server.Atmos.EntitySystems { var nullAir = false; - var enumerator = GetObstructingComponentsEnumerator(mapGrid, indices); + var enumerator = GetObstructingComponentsEnumerator(mapGridComp, indices); while (enumerator.MoveNext(out var airtight)) { @@ -109,7 +109,7 @@ namespace Content.Server.Atmos.EntitySystems } else { - if (tile.Air == null && NeedsVacuumFixing(mapGrid, indices)) + if (tile.Air == null && NeedsVacuumFixing(mapGridComp, indices)) { var vacuumEv = new FixTileVacuumMethodEvent(uid, indices); GridFixTileVacuum(uid, atmosphere, ref vacuumEv); @@ -133,12 +133,12 @@ namespace Content.Server.Atmos.EntitySystems AddActiveTile(atmosphere, tile); // TODO ATMOS: Query all the contents of this tile (like walls) and calculate the correct thermal conductivity and heat capacity - var tileDef = mapGrid.TryGetTileRef(indices, out var tileRef) + var tileDef = mapGridComp.TryGetTileRef(indices, out var tileRef) ? tileRef.GetContentTileDefinition(_tileDefinitionManager) : null; tile.ThermalConductivity = tileDef?.ThermalConductivity ?? 0.5f; tile.HeatCapacity = tileDef?.HeatCapacity ?? float.PositiveInfinity; - InvalidateVisuals(mapGrid.GridEntityId, indices); + InvalidateVisuals(mapGridComp.GridEntityId, indices); for (var i = 0; i < Atmospherics.Directions; i++) { @@ -171,12 +171,10 @@ namespace Content.Server.Atmos.EntitySystems if (!TryComp(uid, out MapGridComponent? mapGridComp)) throw new Exception("Tried to process a grid atmosphere on an entity that isn't a grid!"); - var mapGrid = mapGridComp.Grid; - var number = 0; while (atmosphere.CurrentRunTiles.TryDequeue(out var tile)) { - EqualizePressureInZone(mapGrid, atmosphere, tile, atmosphere.UpdateCounter); + EqualizePressureInZone(mapGridComp, atmosphere, tile, atmosphere.UpdateCounter); if (number++ < LagCheckIterations) continue; number = 0; diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Utils.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Utils.cs index ab23d98d57..be710390c1 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Utils.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Utils.cs @@ -3,6 +3,7 @@ using Content.Server.Atmos.Components; using Content.Shared.Atmos; using Content.Shared.Maps; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.Atmos.EntitySystems; @@ -38,7 +39,7 @@ public partial class AtmosphereSystem _gasTileOverlaySystem.Invalidate(gridUid, tile); } - public bool NeedsVacuumFixing(IMapGrid mapGrid, Vector2i indices) + public bool NeedsVacuumFixing(MapGridComponent mapGrid, Vector2i indices) { var value = false; @@ -58,7 +59,7 @@ public partial class AtmosphereSystem /// The grid in question. /// The amount of tiles. /// The volume in liters that the tiles occupy. - private float GetVolumeForTiles(IMapGrid mapGrid, int tiles = 1) + private float GetVolumeForTiles(MapGridComponent mapGrid, int tiles = 1) { return Atmospherics.CellVolume * mapGrid.TileSize * tiles; } @@ -69,7 +70,7 @@ public partial class AtmosphereSystem /// The grid where to get the tile. /// The indices of the tile. /// The enumerator for the airtight components. - public AtmosObstructionEnumerator GetObstructingComponentsEnumerator(IMapGrid mapGrid, Vector2i tile) + public AtmosObstructionEnumerator GetObstructingComponentsEnumerator(MapGridComponent mapGrid, Vector2i tile) { var ancEnumerator = mapGrid.GetAnchoredEntitiesEnumerator(tile); var airQuery = GetEntityQuery(); @@ -78,7 +79,7 @@ public partial class AtmosphereSystem return enumerator; } - private AtmosDirection GetBlockedDirections(IMapGrid mapGrid, Vector2i indices) + private AtmosDirection GetBlockedDirections(MapGridComponent mapGrid, Vector2i indices) { var value = AtmosDirection.Invalid; @@ -98,7 +99,7 @@ public partial class AtmosphereSystem /// /// The grid in question. /// The indices of the tile. - private void PryTile(IMapGrid mapGrid, Vector2i tile) + private void PryTile(MapGridComponent mapGrid, Vector2i tile) { if (!mapGrid.TryGetTileRef(tile, out var tileRef)) return; diff --git a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs index 2c80b1d1e0..af60012ed9 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs @@ -22,6 +22,7 @@ using Robust.Server.Maps; using Robust.Shared.Audio; using Robust.Shared.Configuration; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Player; using Robust.Shared.Random; using Robust.Shared.Timing; @@ -405,7 +406,7 @@ public sealed partial class CargoSystem var offset = 0f; if (TryComp(orderDatabase.Shuttle, out var shuttleGrid)) { - var bounds = shuttleGrid.Grid.LocalAABB; + var bounds = shuttleGrid.LocalAABB; offset = MathF.Max(bounds.Width, bounds.Height) / 2f; } diff --git a/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs b/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs index 858a2c2914..59a915b63d 100644 --- a/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs +++ b/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs @@ -6,6 +6,7 @@ using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Reagent; using Content.Shared.FixedPoint; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Prototypes; using Robust.Shared.Utility; @@ -73,8 +74,7 @@ namespace Content.Server.Chemistry.Components if (!_entities.TryGetComponent(xform.GridUid, out MapGridComponent? gridComp)) return; - var grid = gridComp.Grid; - var origin = grid.TileIndicesFor(xform.Coordinates); + var origin = gridComp.TileIndicesFor(xform.Coordinates); DebugTools.Assert(xform.Anchored, "Area effect entity prototypes must be anchored."); @@ -82,10 +82,10 @@ namespace Content.Server.Chemistry.Components { // Currently no support for spreading off or across grids. var index = origin + dir.ToIntVec(); - if (!grid.TryGetTileRef(index, out var tile) || tile.Tile.IsEmpty) + if (!gridComp.TryGetTileRef(index, out var tile) || tile.Tile.IsEmpty) return; - foreach (var neighbor in grid.GetAnchoredEntities(index)) + foreach (var neighbor in gridComp.GetAnchoredEntities(index)) { if (_entities.TryGetComponent(neighbor, out SolutionAreaEffectComponent? comp) && comp.Inception == Inception) @@ -100,7 +100,7 @@ namespace Content.Server.Chemistry.Components var newEffect = _entities.SpawnEntity( meta.EntityPrototype.ID, - grid.GridTileToLocal(index)); + gridComp.GridTileToLocal(index)); if (!_entities.TryGetComponent(newEffect, out SolutionAreaEffectComponent? effectComponent)) { diff --git a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs index 2fbb6f2f29..6b1a64ca32 100644 --- a/Content.Server/Chemistry/EntitySystems/VaporSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/VaporSystem.cs @@ -9,6 +9,7 @@ using Content.Shared.Throwing; using Content.Shared.Vapor; using JetBrains.Annotations; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; using Robust.Shared.Physics.Events; @@ -109,7 +110,7 @@ namespace Content.Server.Chemistry.EntitySystems { vapor.ReactTimer = 0; - var tile = gridComp.Grid.GetTileRef(xform.Coordinates.ToVector2i(EntityManager, _mapManager)); + var tile = gridComp.GetTileRef(xform.Coordinates.ToVector2i(EntityManager, _mapManager)); foreach (var reagentQuantity in contents.Contents.ToArray()) { if (reagentQuantity.Quantity == FixedPoint2.Zero) continue; diff --git a/Content.Server/Coordinates/Helpers/SnapgridHelper.cs b/Content.Server/Coordinates/Helpers/SnapgridHelper.cs index 78fcde94c4..406ac9838b 100644 --- a/Content.Server/Coordinates/Helpers/SnapgridHelper.cs +++ b/Content.Server/Coordinates/Helpers/SnapgridHelper.cs @@ -1,4 +1,5 @@ using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.Coordinates.Helpers { @@ -26,7 +27,7 @@ namespace Content.Server.Coordinates.Helpers return new EntityCoordinates(coordinates.EntityId, x, y); } - public static EntityCoordinates SnapToGrid(this EntityCoordinates coordinates, IMapGrid grid) + public static EntityCoordinates SnapToGrid(this EntityCoordinates coordinates, MapGridComponent grid) { var tileSize = grid.TileSize; diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs index 7153799825..13ee10d512 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs @@ -26,6 +26,7 @@ using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Physics.Components; using Robust.Shared.Player; using Robust.Shared.Random; @@ -515,7 +516,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems return false; var coords = xform.Coordinates; - var entry = grid.Grid.GetLocal(coords) + var entry = grid.GetLocal(coords) .FirstOrDefault(entity => EntityManager.HasComponent(entity)); if (entry == default) diff --git a/Content.Server/Doors/Systems/FirelockSystem.cs b/Content.Server/Doors/Systems/FirelockSystem.cs index e1c2e2229b..f695fdd5da 100644 --- a/Content.Server/Doors/Systems/FirelockSystem.cs +++ b/Content.Server/Doors/Systems/FirelockSystem.cs @@ -13,6 +13,7 @@ using Content.Shared.Doors.Components; using Content.Shared.Doors.Systems; using Microsoft.Extensions.Options; using Robust.Server.GameObjects; +using Robust.Shared.Map.Components; using Robust.Shared.Player; namespace Content.Server.Doors.Systems @@ -233,7 +234,7 @@ namespace Content.Server.Doors.Systems if (!TryComp(xform.ParentUid, out GridAtmosphereComponent? gridAtmosphere)) return (false, false); - var grid = Comp(xform.ParentUid).Grid; + var grid = Comp(xform.ParentUid); var pos = grid.CoordinatesToTile(xform.Coordinates); var minPressure = float.MaxValue; var maxPressure = float.MinValue; diff --git a/Content.Server/Dragon/DragonSystem.Rule.cs b/Content.Server/Dragon/DragonSystem.Rule.cs index 1324467925..4c86634124 100644 --- a/Content.Server/Dragon/DragonSystem.Rule.cs +++ b/Content.Server/Dragon/DragonSystem.Rule.cs @@ -3,6 +3,7 @@ using Content.Server.GameTicking; using Content.Server.StationEvents.Components; using Content.Shared.Dragon; using Robust.Server.GameObjects; +using Robust.Shared.Map.Components; using Robust.Shared.Random; namespace Content.Server.Dragon; diff --git a/Content.Server/Electrocution/ElectrocutionNode.cs b/Content.Server/Electrocution/ElectrocutionNode.cs index 336a99e772..bb4cc5f7fc 100644 --- a/Content.Server/Electrocution/ElectrocutionNode.cs +++ b/Content.Server/Electrocution/ElectrocutionNode.cs @@ -1,6 +1,7 @@ using Content.Server.NodeContainer; using Content.Server.NodeContainer.Nodes; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.Electrocution { @@ -15,7 +16,7 @@ namespace Content.Server.Electrocution public override IEnumerable GetReachableNodes(TransformComponent xform, EntityQuery nodeQuery, EntityQuery xformQuery, - IMapGrid? grid, + MapGridComponent? grid, IEntityManager entMan) { if (!nodeQuery.TryGetComponent(CableEntity, out var nodeContainer)) diff --git a/Content.Server/Explosion/EntitySystems/ExplosionGridTileFlood.cs b/Content.Server/Explosion/EntitySystems/ExplosionGridTileFlood.cs index b67c619c1a..61037defa8 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionGridTileFlood.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionGridTileFlood.cs @@ -1,5 +1,6 @@ using Content.Shared.Atmos; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using static Content.Server.Explosion.EntitySystems.ExplosionSystem; namespace Content.Server.Explosion.EntitySystems; @@ -9,7 +10,7 @@ namespace Content.Server.Explosion.EntitySystems; /// public sealed class ExplosionGridTileFlood : ExplosionTileFlood { - public IMapGrid Grid; + public MapGridComponent Grid; private bool _needToTransform = false; private Matrix3 _matrix = Matrix3.Identity; @@ -35,7 +36,7 @@ public sealed class ExplosionGridTileFlood : ExplosionTileFlood private Dictionary _edgeTiles; public ExplosionGridTileFlood( - IMapGrid grid, + MapGridComponent grid, Dictionary airtightMap, float maxIntensity, float intensityStepSize, @@ -179,7 +180,7 @@ public sealed class ExplosionGridTileFlood : ExplosionTileFlood if (EnteredBlockedTiles.Contains(tile)) return; - // Did the explosion already attempt to enter this tile from some other direction? + // Did the explosion already attempt to enter this tile from some other direction? if (!UnenteredBlockedTiles.Add(tile)) return; @@ -203,7 +204,7 @@ public sealed class ExplosionGridTileFlood : ExplosionTileFlood if (!EnteredBlockedTiles.Add(tile)) return; - // Did the explosion already attempt to enter this tile from some other direction? + // Did the explosion already attempt to enter this tile from some other direction? if (UnenteredBlockedTiles.Contains(tile)) { NewFreedTiles.Add(tile); diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Airtight.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Airtight.cs index aabc78b743..75519900da 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Airtight.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Airtight.cs @@ -5,6 +5,7 @@ using Content.Shared.Damage; using Content.Shared.Explosion; using Content.Shared.FixedPoint; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.Explosion.EntitySystems; @@ -57,7 +58,7 @@ public sealed partial class ExplosionSystem : EntitySystem /// something like a normal and a reinforced windoor on the same tile. But given that this is a pretty rare /// occurrence, I am fine with this. /// - public void UpdateAirtightMap(IMapGrid grid, Vector2i tile, EntityQuery? query = null) + public void UpdateAirtightMap(MapGridComponent grid, Vector2i tile, EntityQuery? query = null) { var tolerance = new float[_explosionTypes.Count]; var blockedDirections = AtmosDirection.Invalid; diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs index 48ccf4bff7..2b34dc181f 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.GridMap.cs @@ -1,5 +1,7 @@ using Content.Shared.Atmos; using Robust.Shared.Map; +using Robust.Shared.Map.Components; + namespace Content.Server.Explosion.EntitySystems; // This partial part of the explosion system has all of the functions used to facilitate explosions moving across grids. @@ -289,7 +291,7 @@ public sealed partial class ExplosionSystem : EntitySystem /// Optionally ignore a specific Vector2i. Used by when we already know that a /// given tile is not space. This avoids unnecessary TryGetTileRef calls. /// - private bool IsEdge(IMapGrid grid, Vector2i index, out NeighborFlag spaceDirections) + private bool IsEdge(MapGridComponent grid, Vector2i index, out NeighborFlag spaceDirections) { spaceDirections = NeighborFlag.Invalid; for (var i = 0; i < NeighbourVectors.Length; i++) diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs index 987b77790e..9fdf3cab55 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.Processing.cs @@ -4,6 +4,7 @@ using Content.Shared.Explosion; using Content.Shared.Maps; using Content.Shared.Physics; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; @@ -194,7 +195,7 @@ public sealed partial class ExplosionSystem : EntitySystem /// /// True if the underlying tile can be uprooted, false if the tile is blocked by a dense entity internal bool ExplodeTile(BroadphaseComponent lookup, - IMapGrid grid, + MapGridComponent grid, Vector2i tile, float throwForce, DamageSpecifier damage, @@ -494,7 +495,7 @@ sealed class Explosion /// /// The actual grid that this corresponds to. If null, this implies space. /// - public IMapGrid? MapGrid; + public MapGridComponent? MapGrid; } private readonly List _explosionData = new(); @@ -543,7 +544,7 @@ sealed class Explosion // Variables used for enumerating over tiles, grids, etc private DamageSpecifier _currentDamage = default!; private BroadphaseComponent _currentLookup = default!; - private IMapGrid? _currentGrid; + private MapGridComponent? _currentGrid; private float _currentIntensity; private float _currentThrowForce; private List.Enumerator _currentEnumerator; @@ -553,7 +554,7 @@ sealed class Explosion /// The set of tiles that need to be updated when the explosion has finished processing. Used to avoid having /// the explosion trigger chunk regeneration & shuttle-system processing every tick. /// - private readonly Dictionary> _tileUpdateDict = new(); + private readonly Dictionary> _tileUpdateDict = new(); // Entity Queries private readonly EntityQuery _xformQuery; @@ -642,7 +643,7 @@ sealed class Explosion _explosionData.Add(new() { TileLists = grid.TileLists, - Lookup = entMan.GetComponent(grid.Grid.GridEntityId), + Lookup = entMan.GetComponent(grid.Grid.Owner), MapGrid = grid.Grid }); } diff --git a/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs b/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs index 1d4b5b5998..d1cd0e5723 100644 --- a/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs +++ b/Content.Server/Explosion/EntitySystems/ExplosionSystem.cs @@ -319,7 +319,7 @@ public sealed partial class ExplosionSystem : EntitySystem Dictionary>> tileLists = new(); foreach (var grid in gridData) { - tileLists.Add(grid.Grid.GridEntityId, grid.TileLists); + tileLists.Add(grid.Grid.Owner, grid.TileLists); } return new ExplosionEvent(_explosionCounter, epicenter, id, iterationIntensity, spaceTiles, tileLists, spaceMatrix, spaceData?.TileSize ?? DefaultTileSize); diff --git a/Content.Server/Fluids/EntitySystems/FluidSpreaderSystem.cs b/Content.Server/Fluids/EntitySystems/FluidSpreaderSystem.cs index db0cf6eaa5..84f0fc263d 100644 --- a/Content.Server/Fluids/EntitySystems/FluidSpreaderSystem.cs +++ b/Content.Server/Fluids/EntitySystems/FluidSpreaderSystem.cs @@ -6,6 +6,9 @@ using Content.Shared.Directions; using Content.Shared.Physics; using JetBrains.Annotations; using Robust.Shared.Map; +using Robust.Shared.Map.Components; +using Robust.Shared.Physics; +using Robust.Shared.Utility; using Robust.Shared.Physics.Components; using Robust.Shared.Timing; @@ -101,7 +104,7 @@ public sealed class FluidSpreaderSystem : EntitySystem /// helper param needed to extract entities /// either found or newly created PuddleComponent. /// true if tile is empty or occupied by a non-overflowing puddle (or a puddle close to being overflowing) - private bool CheckTile(EntityUid srcUid, PuddleComponent srcPuddle, EntityCoordinates pos, IMapGrid mapGrid, + private bool CheckTile(EntityUid srcUid, PuddleComponent srcPuddle, EntityCoordinates pos, MapGridComponent mapGrid, [NotNullWhen(true)] out PuddleComponent? puddle) { if (!mapGrid.TryGetTileRef(pos, out var tileRef) diff --git a/Content.Server/GameTicking/Rules/PiratesRuleSystem.cs b/Content.Server/GameTicking/Rules/PiratesRuleSystem.cs index 35e0bf7551..afb74adcfb 100644 --- a/Content.Server/GameTicking/Rules/PiratesRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/PiratesRuleSystem.cs @@ -153,7 +153,7 @@ public sealed class PiratesRuleSystem : GameRuleSystem var xformQuery = GetEntityQuery(); var aabbs = _stationSystem.Stations.SelectMany(x => - Comp(x).Grids.Select(x => xformQuery.GetComponent(x).WorldMatrix.TransformBox(_mapManager.GetGridComp(x).Grid.LocalAABB))).ToArray(); + Comp(x).Grids.Select(x => xformQuery.GetComponent(x).WorldMatrix.TransformBox(_mapManager.GetGridComp(x).LocalAABB))).ToArray(); var aabb = aabbs[0]; diff --git a/Content.Server/GameTicking/Rules/SuspicionRuleSystem.cs b/Content.Server/GameTicking/Rules/SuspicionRuleSystem.cs index d14b525d1d..22d27d24b7 100644 --- a/Content.Server/GameTicking/Rules/SuspicionRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/SuspicionRuleSystem.cs @@ -22,6 +22,7 @@ using Robust.Shared.Audio; using Robust.Shared.Configuration; using Robust.Shared.Enums; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; @@ -215,7 +216,7 @@ public sealed class SuspicionRuleSystem : GameRuleSystem foreach (var (_, mapGrid) in EntityManager.EntityQuery(true)) { // I'm so sorry. - var tiles = mapGrid.Grid.GetAllTiles().ToArray(); + var tiles = mapGrid.GetAllTiles().ToArray(); Logger.Info($"TILES: {tiles.Length}"); var spawn = susLoot.GetSpawns(); diff --git a/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs b/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs index 881e8c2a3b..422374d785 100644 --- a/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs +++ b/Content.Server/NPC/Pathfinding/PathfindingSystem.Grid.cs @@ -10,6 +10,7 @@ using Content.Shared.Physics; using Microsoft.Extensions.ObjectPool; using Robust.Shared.Collections; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Events; @@ -140,7 +141,7 @@ public sealed partial class PathfindingSystem var fixturesQuery = GetEntityQuery(); var physicsQuery = GetEntityQuery(); var xformQuery = GetEntityQuery(); - BuildBreadcrumbs(dirt[i], mapGridComp.Grid, accessQuery, destructibleQuery, doorQuery, fixturesQuery, physicsQuery, xformQuery); + BuildBreadcrumbs(dirt[i], mapGridComp, accessQuery, destructibleQuery, doorQuery, fixturesQuery, physicsQuery, xformQuery); } const int Division = 4; @@ -361,7 +362,7 @@ public sealed partial class PathfindingSystem } private void BuildBreadcrumbs(GridPathfindingChunk chunk, - IMapGrid grid, + MapGridComponent grid, EntityQuery accessQuery, EntityQuery destructibleQuery, EntityQuery doorQuery, diff --git a/Content.Server/NodeContainer/Nodes/AdjacentNode.cs b/Content.Server/NodeContainer/Nodes/AdjacentNode.cs index 3660fb70f3..cbead87846 100644 --- a/Content.Server/NodeContainer/Nodes/AdjacentNode.cs +++ b/Content.Server/NodeContainer/Nodes/AdjacentNode.cs @@ -1,4 +1,5 @@ using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.NodeContainer.Nodes { @@ -11,7 +12,7 @@ namespace Content.Server.NodeContainer.Nodes public override IEnumerable GetReachableNodes(TransformComponent xform, EntityQuery nodeQuery, EntityQuery xformQuery, - IMapGrid? grid, + MapGridComponent? grid, IEntityManager entMan) { if (!xform.Anchored || grid == null) diff --git a/Content.Server/NodeContainer/Nodes/Node.cs b/Content.Server/NodeContainer/Nodes/Node.cs index f853c398b7..480fa271a3 100644 --- a/Content.Server/NodeContainer/Nodes/Node.cs +++ b/Content.Server/NodeContainer/Nodes/Node.cs @@ -1,6 +1,7 @@ using Content.Server.NodeContainer.EntitySystems; using Content.Server.NodeContainer.NodeGroups; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.NodeContainer.Nodes { @@ -97,7 +98,7 @@ namespace Content.Server.NodeContainer.Nodes public abstract IEnumerable GetReachableNodes(TransformComponent xform, EntityQuery nodeQuery, EntityQuery xformQuery, - IMapGrid? grid, + MapGridComponent? grid, IEntityManager entMan); } } diff --git a/Content.Server/NodeContainer/Nodes/NodeHelpers.cs b/Content.Server/NodeContainer/Nodes/NodeHelpers.cs index 294b10670d..ad6d59dbaf 100644 --- a/Content.Server/NodeContainer/Nodes/NodeHelpers.cs +++ b/Content.Server/NodeContainer/Nodes/NodeHelpers.cs @@ -1,5 +1,6 @@ using System.Diagnostics.CodeAnalysis; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.NodeContainer.Nodes { @@ -8,7 +9,7 @@ namespace Content.Server.NodeContainer.Nodes /// public static class NodeHelpers { - public static IEnumerable GetNodesInTile(EntityQuery nodeQuery, IMapGrid grid, Vector2i coords) + public static IEnumerable GetNodesInTile(EntityQuery nodeQuery, MapGridComponent grid, Vector2i coords) { foreach (var entityUid in grid.GetAnchoredEntities(coords)) { @@ -24,7 +25,7 @@ namespace Content.Server.NodeContainer.Nodes public static IEnumerable<(Direction dir, Node node)> GetCardinalNeighborNodes( EntityQuery nodeQuery, - IMapGrid grid, + MapGridComponent grid, Vector2i coords, bool includeSameTile = true) { @@ -42,7 +43,7 @@ namespace Content.Server.NodeContainer.Nodes [SuppressMessage("ReSharper", "EnforceForeachStatementBraces")] public static IEnumerable<(Direction dir, EntityUid entity)> GetCardinalNeighborCells( - IMapGrid grid, + MapGridComponent grid, Vector2i coords, bool includeSameTile = true) { diff --git a/Content.Server/NodeContainer/Nodes/PipeNode.cs b/Content.Server/NodeContainer/Nodes/PipeNode.cs index 1454413869..a10efcfa77 100644 --- a/Content.Server/NodeContainer/Nodes/PipeNode.cs +++ b/Content.Server/NodeContainer/Nodes/PipeNode.cs @@ -3,6 +3,7 @@ using Content.Server.NodeContainer.EntitySystems; using Content.Server.NodeContainer.NodeGroups; using Content.Shared.Atmos; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Utility; namespace Content.Server.NodeContainer.Nodes @@ -152,7 +153,7 @@ namespace Content.Server.NodeContainer.Nodes public override IEnumerable GetReachableNodes(TransformComponent xform, EntityQuery nodeQuery, EntityQuery xformQuery, - IMapGrid? grid, + MapGridComponent? grid, IEntityManager entMan) { if (_alwaysReachable != null) @@ -195,7 +196,7 @@ namespace Content.Server.NodeContainer.Nodes /// /// Gets the pipes that can connect to us from entities on the tile or adjacent in a direction. /// - private IEnumerable LinkableNodesInDirection(Vector2i pos, PipeDirection pipeDir, IMapGrid grid, + private IEnumerable LinkableNodesInDirection(Vector2i pos, PipeDirection pipeDir, MapGridComponent grid, EntityQuery nodeQuery) { foreach (var pipe in PipesInDirection(pos, pipeDir, grid, nodeQuery)) @@ -211,7 +212,7 @@ namespace Content.Server.NodeContainer.Nodes /// /// Gets the pipes from entities on the tile adjacent in a direction. /// - protected IEnumerable PipesInDirection(Vector2i pos, PipeDirection pipeDir, IMapGrid grid, + protected IEnumerable PipesInDirection(Vector2i pos, PipeDirection pipeDir, MapGridComponent grid, EntityQuery nodeQuery) { var offsetPos = pos.Offset(pipeDir.ToDirection()); diff --git a/Content.Server/NodeContainer/Nodes/PortPipeNode.cs b/Content.Server/NodeContainer/Nodes/PortPipeNode.cs index 740e04ae23..5a11b75286 100644 --- a/Content.Server/NodeContainer/Nodes/PortPipeNode.cs +++ b/Content.Server/NodeContainer/Nodes/PortPipeNode.cs @@ -1,4 +1,5 @@ using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.NodeContainer.Nodes { @@ -8,7 +9,7 @@ namespace Content.Server.NodeContainer.Nodes public override IEnumerable GetReachableNodes(TransformComponent xform, EntityQuery nodeQuery, EntityQuery xformQuery, - IMapGrid? grid, + MapGridComponent? grid, IEntityManager entMan) { if (!xform.Anchored || grid == null) diff --git a/Content.Server/NodeContainer/Nodes/PortablePipeNode.cs b/Content.Server/NodeContainer/Nodes/PortablePipeNode.cs index d4d73924fa..a8a2dd65de 100644 --- a/Content.Server/NodeContainer/Nodes/PortablePipeNode.cs +++ b/Content.Server/NodeContainer/Nodes/PortablePipeNode.cs @@ -1,4 +1,5 @@ using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.NodeContainer.Nodes { @@ -8,7 +9,7 @@ namespace Content.Server.NodeContainer.Nodes public override IEnumerable GetReachableNodes(TransformComponent xform, EntityQuery nodeQuery, EntityQuery xformQuery, - IMapGrid? grid, + MapGridComponent? grid, IEntityManager entMan) { if (!xform.Anchored || grid == null) diff --git a/Content.Server/Objectives/Conditions/EscapeShuttleCondition.cs b/Content.Server/Objectives/Conditions/EscapeShuttleCondition.cs index 14c2c2b3e2..238b30718f 100644 --- a/Content.Server/Objectives/Conditions/EscapeShuttleCondition.cs +++ b/Content.Server/Objectives/Conditions/EscapeShuttleCondition.cs @@ -2,6 +2,7 @@ using Content.Server.Cuffs.Components; using Content.Server.Objectives.Interfaces; using Content.Server.Station.Components; using JetBrains.Annotations; +using Robust.Shared.Map.Components; using Robust.Shared.Utility; namespace Content.Server.Objectives.Conditions @@ -38,7 +39,7 @@ namespace Content.Server.Objectives.Conditions return false; } - return shuttleXform.WorldMatrix.TransformBox(shuttleGrid.Grid.LocalAABB).Contains(agentXform.WorldPosition); + return shuttleXform.WorldMatrix.TransformBox(shuttleGrid.LocalAABB).Contains(agentXform.WorldPosition); } public float Progress diff --git a/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs b/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs index feea4fc4c6..604d181d2d 100644 --- a/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs +++ b/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs @@ -12,6 +12,7 @@ using Content.Shared.Singularity.Components; using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Utility; // using static Content.Shared.Wires.SharedWiresComponent; using Timer = Robust.Shared.Timing.Timer; @@ -344,7 +345,7 @@ namespace Content.Server.ParticleAccelerator.Components // Find fuel chamber first by scanning cardinals. if (xform.Anchored && _entMan.TryGetComponent(xform.GridUid, out MapGridComponent? grid)) { - foreach (var maybeFuel in grid.Grid.GetCardinalNeighborCells(xform.Coordinates)) + foreach (var maybeFuel in grid.GetCardinalNeighborCells(xform.Coordinates)) { if (_entMan.TryGetComponent(maybeFuel, out _partFuelChamber)) { diff --git a/Content.Server/Power/Nodes/CableDeviceNode.cs b/Content.Server/Power/Nodes/CableDeviceNode.cs index 0558ae63a4..d823247f39 100644 --- a/Content.Server/Power/Nodes/CableDeviceNode.cs +++ b/Content.Server/Power/Nodes/CableDeviceNode.cs @@ -1,6 +1,7 @@ using Content.Server.NodeContainer; using Content.Server.NodeContainer.Nodes; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.Power.Nodes { @@ -14,7 +15,7 @@ namespace Content.Server.Power.Nodes public override IEnumerable GetReachableNodes(TransformComponent xform, EntityQuery nodeQuery, EntityQuery xformQuery, - IMapGrid? grid, + MapGridComponent? grid, IEntityManager entMan) { if (!xform.Anchored || grid == null) diff --git a/Content.Server/Power/Nodes/CableNode.cs b/Content.Server/Power/Nodes/CableNode.cs index 0c2faae84e..16968ed5a7 100644 --- a/Content.Server/Power/Nodes/CableNode.cs +++ b/Content.Server/Power/Nodes/CableNode.cs @@ -1,6 +1,7 @@ using Content.Server.NodeContainer; using Content.Server.NodeContainer.Nodes; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.Power.Nodes { @@ -10,7 +11,7 @@ namespace Content.Server.Power.Nodes public override IEnumerable GetReachableNodes(TransformComponent xform, EntityQuery nodeQuery, EntityQuery xformQuery, - IMapGrid? grid, + MapGridComponent? grid, IEntityManager entMan) { if (!xform.Anchored || grid == null) diff --git a/Content.Server/Power/Nodes/CableTerminalNode.cs b/Content.Server/Power/Nodes/CableTerminalNode.cs index 31d4f69e82..de56810a13 100644 --- a/Content.Server/Power/Nodes/CableTerminalNode.cs +++ b/Content.Server/Power/Nodes/CableTerminalNode.cs @@ -1,6 +1,7 @@ using Content.Server.NodeContainer; using Content.Server.NodeContainer.Nodes; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.Power.Nodes { @@ -10,7 +11,7 @@ namespace Content.Server.Power.Nodes public override IEnumerable GetReachableNodes(TransformComponent xform, EntityQuery nodeQuery, EntityQuery xformQuery, - IMapGrid? grid, + MapGridComponent? grid, IEntityManager entMan) { if (!xform.Anchored || grid == null) diff --git a/Content.Server/Power/Nodes/CableTerminalPortNode.cs b/Content.Server/Power/Nodes/CableTerminalPortNode.cs index 5fe320b4b0..72baf124af 100644 --- a/Content.Server/Power/Nodes/CableTerminalPortNode.cs +++ b/Content.Server/Power/Nodes/CableTerminalPortNode.cs @@ -1,6 +1,7 @@ using Content.Server.NodeContainer; using Content.Server.NodeContainer.Nodes; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.Power.Nodes { @@ -10,7 +11,7 @@ namespace Content.Server.Power.Nodes public override IEnumerable GetReachableNodes(TransformComponent xform, EntityQuery nodeQuery, EntityQuery xformQuery, - IMapGrid? grid, + MapGridComponent? grid, IEntityManager entMan) { if (!xform.Anchored || grid == null) diff --git a/Content.Server/RCD/Systems/RCDSystem.cs b/Content.Server/RCD/Systems/RCDSystem.cs index 485737dfe5..ef2306b8ce 100644 --- a/Content.Server/RCD/Systems/RCDSystem.cs +++ b/Content.Server/RCD/Systems/RCDSystem.cs @@ -11,6 +11,7 @@ using Content.Shared.Maps; using Content.Shared.Tag; using Robust.Shared.Audio; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Player; namespace Content.Server.RCD.Systems @@ -155,7 +156,7 @@ namespace Content.Server.RCD.Systems args.Handled = true; } - private bool IsRCDStillValid(RCDComponent rcd, AfterInteractEvent eventArgs, IMapGrid mapGrid, TileRef tile, RcdMode startingMode) + private bool IsRCDStillValid(RCDComponent rcd, AfterInteractEvent eventArgs, MapGridComponent mapGrid, TileRef tile, RcdMode startingMode) { //Less expensive checks first. Failing those ones, we need to check that the tile isn't obstructed. if (rcd.CurrentAmmo <= 0) diff --git a/Content.Server/Radiation/Systems/RadiationSystem.Blockers.cs b/Content.Server/Radiation/Systems/RadiationSystem.Blockers.cs index 7585b60c27..d9683ac259 100644 --- a/Content.Server/Radiation/Systems/RadiationSystem.Blockers.cs +++ b/Content.Server/Radiation/Systems/RadiationSystem.Blockers.cs @@ -1,6 +1,7 @@ using Content.Server.Radiation.Components; using Content.Shared.Doors; using Content.Shared.Doors.Components; +using Robust.Shared.Map.Components; namespace Content.Server.Radiation.Systems; @@ -107,7 +108,7 @@ public partial class RadiationSystem // save resistance into rad protection grid var gridId = trs.GridUid.Value; - var tilePos = grid.Grid.TileIndicesFor(trs.Coordinates); + var tilePos = grid.TileIndicesFor(trs.Coordinates); AddToTile(gridId, tilePos, component.RadResistance); // and remember it as last valid position diff --git a/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs b/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs index 55aa68018c..c7a105d677 100644 --- a/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs +++ b/Content.Server/Radiation/Systems/RadiationSystem.GridCast.cs @@ -3,6 +3,7 @@ using Content.Shared.Radiation.Components; using Content.Shared.Radiation.Systems; using Robust.Shared.Collections; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -118,7 +119,7 @@ public partial class RadiationSystem { if (!gridQuery.TryGetComponent(sourceTrs.GridUid.Value, out var gridComponent)) return ray; - return Gridcast(gridComponent.Grid, ray, saveVisitedTiles, resistanceQuery, sourceTrs, destTrs, transformQuery.GetComponent(sourceTrs.GridUid.Value)); + return Gridcast(gridComponent, ray, saveVisitedTiles, resistanceQuery, sourceTrs, destTrs, transformQuery.GetComponent(sourceTrs.GridUid.Value)); } // lets check how many grids are between source and destination @@ -142,7 +143,7 @@ public partial class RadiationSystem return ray; } - private RadiationRay Gridcast(IMapGrid grid, RadiationRay ray, bool saveVisitedTiles, + private RadiationRay Gridcast(MapGridComponent grid, RadiationRay ray, bool saveVisitedTiles, EntityQuery resistanceQuery, TransformComponent sourceTrs, TransformComponent destTrs, diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyShuttle.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyShuttle.cs index da7c5a6b29..f864472aff 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyShuttle.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyShuttle.cs @@ -17,6 +17,7 @@ using Robust.Server.Player; using Robust.Shared.Audio; using Robust.Shared.Configuration; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Player; @@ -115,7 +116,7 @@ public sealed partial class ShuttleSystem /// private bool ValidSpawn(MapGridComponent grid, Box2 area) { - return !grid.Grid.GetLocalTilesIntersecting(area).Any(); + return !grid.GetLocalTilesIntersecting(area).Any(); } private DockingConfig? GetDockingConfig(ShuttleComponent component, EntityUid targetGrid) @@ -131,7 +132,7 @@ public sealed partial class ShuttleSystem var targetGridRotation = targetGridAngle.ToVec(); var shuttleDocks = GetDocks(component.Owner); - var shuttleAABB = Comp(component.Owner).Grid.LocalAABB; + var shuttleAABB = Comp(component.Owner).LocalAABB; var validDockConfigs = new List(); diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs index c476fbbf09..b32d50a065 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.FasterThanLight.cs @@ -15,6 +15,7 @@ using Robust.Shared.Utility; using System.Diagnostics.CodeAnalysis; using Content.Server.Shuttles.Events; using Content.Server.Station.Components; +using Robust.Shared.Map.Components; using Robust.Shared.Physics.Components; namespace Content.Server.Shuttles.Systems; @@ -95,7 +96,7 @@ public sealed partial class ShuttleSystem return true; } - var bounds = xform.WorldMatrix.TransformBox(grid.Grid.LocalAABB).Enlarged(ShuttleFTLRange); + var bounds = xform.WorldMatrix.TransformBox(grid.LocalAABB).Enlarged(ShuttleFTLRange); var bodyQuery = GetEntityQuery(); foreach (var other in _mapManager.FindGridsIntersecting(xform.MapID, bounds)) @@ -226,7 +227,7 @@ public sealed partial class ShuttleSystem comp.State = FTLState.Travelling; - var width = Comp(comp.Owner).Grid.LocalAABB.Width; + var width = Comp(comp.Owner).LocalAABB.Width; xform.Coordinates = new EntityCoordinates(_mapManager.GetMapEntityId(_hyperSpaceMap!.Value), new Vector2(_index + width / 2f, 0f)); xform.LocalRotation = Angle.Zero; _index += width + Buffer; @@ -458,13 +459,13 @@ public sealed partial class ShuttleSystem } var xformQuery = GetEntityQuery(); - var shuttleAABB = Comp(component.Owner).Grid.LocalAABB; + var shuttleAABB = Comp(component.Owner).LocalAABB; // Spawn nearby. // We essentially expand the Box2 of the target area until nothing else is added then we know it's valid. // Can't just get an AABB of every grid as we may spawn very far away. var targetAABB = _transform.GetWorldMatrix(targetXform, xformQuery) - .TransformBox(Comp(targetUid).Grid.LocalAABB).Enlarged(shuttleAABB.Size.Length); + .TransformBox(Comp(targetUid).LocalAABB).Enlarged(shuttleAABB.Size.Length); var nearbyGrids = new HashSet(1) { targetUid }; var iteration = 0; @@ -478,7 +479,7 @@ public sealed partial class ShuttleSystem if (!nearbyGrids.Add(grid.GridEntityId)) continue; targetAABB = targetAABB.Union(_transform.GetWorldMatrix(grid.GridEntityId, xformQuery) - .TransformBox(Comp(grid.GridEntityId).Grid.LocalAABB)); + .TransformBox(Comp(grid.GridEntityId).LocalAABB)); } // Can do proximity @@ -501,7 +502,7 @@ public sealed partial class ShuttleSystem if (nearbyGrids.Contains(grid.GridEntityId)) continue; targetAABB = targetAABB.Union(_transform.GetWorldMatrix(grid.GridEntityId, xformQuery) - .TransformBox(Comp(grid.GridEntityId).Grid.LocalAABB)); + .TransformBox(Comp(grid.GridEntityId).LocalAABB)); } break; diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.cs index a5ee6eee4f..fab9a07722 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.cs @@ -6,6 +6,7 @@ using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Shared.Configuration; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Systems; diff --git a/Content.Server/Singularity/EntitySystems/SingularitySystem.cs b/Content.Server/Singularity/EntitySystems/SingularitySystem.cs index 8b03187d15..9b2e1af8be 100644 --- a/Content.Server/Singularity/EntitySystems/SingularitySystem.cs +++ b/Content.Server/Singularity/EntitySystems/SingularitySystem.cs @@ -7,6 +7,7 @@ using JetBrains.Annotations; using Robust.Server.GameStates; using Robust.Shared.Containers; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; diff --git a/Content.Server/Station/Systems/StationSystem.cs b/Content.Server/Station/Systems/StationSystem.cs index 5a4cfa0cc9..26762b0393 100644 --- a/Content.Server/Station/Systems/StationSystem.cs +++ b/Content.Server/Station/Systems/StationSystem.cs @@ -10,6 +10,7 @@ using Robust.Shared.Collections; using Robust.Shared.Configuration; using Robust.Shared.Enums; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Player; using Robust.Shared.Random; @@ -243,10 +244,10 @@ public sealed class StationSystem : EntitySystem foreach (var gridUid in component.Grids) { if (!TryComp(gridUid, out var grid) || - grid.Grid.LocalAABB.Size.LengthSquared < largestBounds.Size.LengthSquared) + grid.LocalAABB.Size.LengthSquared < largestBounds.Size.LengthSquared) continue; - largestBounds = grid.Grid.LocalAABB; + largestBounds = grid.LocalAABB; largestGrid = gridUid; } diff --git a/Content.Server/StationEvents/Events/StationEventSystem.cs b/Content.Server/StationEvents/Events/StationEventSystem.cs index 1da3e2c4bd..ad16bca20c 100644 --- a/Content.Server/StationEvents/Events/StationEventSystem.cs +++ b/Content.Server/StationEvents/Events/StationEventSystem.cs @@ -9,6 +9,7 @@ using Content.Server.Station.Systems; using Content.Shared.Database; using Robust.Shared.Audio; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; @@ -148,11 +149,9 @@ namespace Content.Server.StationEvents.Events if (!TryComp(targetGrid, out var gridComp)) return false; - var grid = gridComp.Grid; - var found = false; var (gridPos, _, gridMatrix) = Transform(targetGrid).GetWorldPositionRotationMatrix(); - var gridBounds = gridMatrix.TransformBox(grid.LocalAABB); + var gridBounds = gridMatrix.TransformBox(gridComp.LocalAABB); for (var i = 0; i < 10; i++) { @@ -160,15 +159,15 @@ namespace Content.Server.StationEvents.Events var randomY = RobustRandom.Next((int) gridBounds.Bottom, (int) gridBounds.Top); tile = new Vector2i(randomX - (int) gridPos.X, randomY - (int) gridPos.Y); - if (_atmosphere.IsTileSpace(grid.GridEntityId, Transform(targetGrid).MapUid, tile, + if (_atmosphere.IsTileSpace(gridComp.GridEntityId, Transform(targetGrid).MapUid, tile, mapGridComp: gridComp) - || _atmosphere.IsTileAirBlocked(grid.GridEntityId, tile, mapGridComp: gridComp)) + || _atmosphere.IsTileAirBlocked(gridComp.GridEntityId, tile, mapGridComp: gridComp)) { continue; } found = true; - targetCoords = grid.GridTileToLocal(tile); + targetCoords = gridComp.GridTileToLocal(tile); break; } diff --git a/Content.Server/Tabletop/TabletopSystem.Map.cs b/Content.Server/Tabletop/TabletopSystem.Map.cs index fddf83c26f..8f1b8edd20 100644 --- a/Content.Server/Tabletop/TabletopSystem.Map.cs +++ b/Content.Server/Tabletop/TabletopSystem.Map.cs @@ -1,5 +1,6 @@ using Content.Shared.GameTicking; using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Server.Tabletop { diff --git a/Content.Server/Tiles/FloorTileSystem.cs b/Content.Server/Tiles/FloorTileSystem.cs index d4df1ea35b..b4f90327dd 100644 --- a/Content.Server/Tiles/FloorTileSystem.cs +++ b/Content.Server/Tiles/FloorTileSystem.cs @@ -5,6 +5,7 @@ using Content.Shared.Maps; using Content.Shared.Physics; using Robust.Shared.Audio; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Player; @@ -94,7 +95,7 @@ namespace Content.Server.Tiles return false; } - private void PlaceAt(IMapGrid mapGrid, EntityCoordinates location, ushort tileId, SoundSpecifier placeSound, float offset = 0) + private void PlaceAt(MapGridComponent mapGrid, EntityCoordinates location, ushort tileId, SoundSpecifier placeSound, float offset = 0) { var variant = _random.Pick(((ContentTileDefinition) _tileDefinitionManager[tileId]).PlacementVariants); mapGrid.SetTile(location.Offset(new Vector2(offset, offset)), new Tile(tileId, 0, variant)); diff --git a/Content.Shared/Coordinates/EntityCoordinatesExtensions.cs b/Content.Shared/Coordinates/EntityCoordinatesExtensions.cs index 0e02bf99f5..fa2a9d941b 100644 --- a/Content.Shared/Coordinates/EntityCoordinatesExtensions.cs +++ b/Content.Shared/Coordinates/EntityCoordinatesExtensions.cs @@ -1,4 +1,5 @@ using Robust.Shared.Map; +using Robust.Shared.Map.Components; namespace Content.Shared.Coordinates { @@ -19,17 +20,17 @@ namespace Content.Shared.Coordinates return new EntityCoordinates(id, x, y); } - public static EntityCoordinates ToCoordinates(this IMapGrid grid, Vector2 offset) + public static EntityCoordinates ToCoordinates(this MapGridComponent grid, Vector2 offset) { return ToCoordinates(grid.GridEntityId, offset); } - public static EntityCoordinates ToCoordinates(this IMapGrid grid, float x, float y) + public static EntityCoordinates ToCoordinates(this MapGridComponent grid, float x, float y) { return ToCoordinates(grid.GridEntityId, x, y); } - public static EntityCoordinates ToCoordinates(this IMapGrid grid) + public static EntityCoordinates ToCoordinates(this MapGridComponent grid) { return ToCoordinates(grid.GridEntityId, Vector2.Zero); } diff --git a/Content.Shared/Singularity/SharedSingularitySystem.cs b/Content.Shared/Singularity/SharedSingularitySystem.cs index b1c66ebbd9..c065a5bc14 100644 --- a/Content.Shared/Singularity/SharedSingularitySystem.cs +++ b/Content.Shared/Singularity/SharedSingularitySystem.cs @@ -2,6 +2,7 @@ using Content.Shared.Ghost; using Content.Shared.Radiation; using Content.Shared.Radiation.Components; using Content.Shared.Singularity.Components; +using Robust.Shared.Map.Components; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; using Robust.Shared.Physics.Components; diff --git a/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs b/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs index 8f118c87c3..87951475a4 100644 --- a/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs +++ b/Content.Shared/SubFloor/SharedSubFloorHideSystem.cs @@ -3,6 +3,7 @@ using Content.Shared.Interaction.Events; using Content.Shared.Maps; using JetBrains.Annotations; using Robust.Shared.Map; +using Robust.Shared.Map.Components; using Robust.Shared.Serialization; namespace Content.Shared.SubFloor @@ -107,14 +108,14 @@ namespace Content.Shared.SubFloor UpdateAppearance(uid, component); } - public bool HasFloorCover(IMapGrid grid, Vector2i position) + public bool HasFloorCover(MapGridComponent grid, Vector2i position) { // TODO Redo this function. Currently wires on an asteroid are always "below the floor" var tileDef = (ContentTileDefinition) _tileDefinitionManager[grid.GetTileRef(position).Tile.TypeId]; return !tileDef.IsSubFloor; } - private void UpdateTile(IMapGrid grid, Vector2i position) + private void UpdateTile(MapGridComponent grid, Vector2i position) { var covered = HasFloorCover(grid, position); diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml index cd9dabcc86..44854877d5 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/meteors.yml @@ -33,7 +33,7 @@ density: 100 hard: true id: projectile - # Didn't use MapGrid for now as the bounds are stuffed. + # Didn't use MapGridComponent for now as the bounds are stuffed. layer: - LargeMobLayer mask: