Content side for removing IMap / IMapGrid comps (#12357)
This commit is contained in:
@@ -56,7 +56,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
var xform = Transform(uid);
|
||||
|
||||
if (!TryComp(xform.GridUid, out IMapGridComponent? grid))
|
||||
if (!TryComp(xform.GridUid, out MapGridComponent? grid))
|
||||
return;
|
||||
|
||||
var gridId = xform.GridUid;
|
||||
|
||||
@@ -121,7 +121,7 @@ public partial class AtmosphereSystem
|
||||
return ev.Result;
|
||||
}
|
||||
|
||||
public bool IsTileAirBlocked(EntityUid gridUid, Vector2i tile, AtmosDirection directions = AtmosDirection.All, IMapGridComponent? mapGridComp = null)
|
||||
public bool IsTileAirBlocked(EntityUid gridUid, Vector2i tile, AtmosDirection directions = AtmosDirection.All, MapGridComponent? mapGridComp = null)
|
||||
{
|
||||
var ev = new IsTileAirBlockedMethodEvent(gridUid, tile, directions, mapGridComp);
|
||||
RaiseLocalEvent(gridUid, ref ev);
|
||||
@@ -130,7 +130,7 @@ public partial class AtmosphereSystem
|
||||
return ev.Result;
|
||||
}
|
||||
|
||||
public bool IsTileSpace(EntityUid? gridUid, EntityUid? mapUid, Vector2i tile, IMapGridComponent? mapGridComp = null)
|
||||
public bool IsTileSpace(EntityUid? gridUid, EntityUid? mapUid, Vector2i tile, MapGridComponent? mapGridComp = null)
|
||||
{
|
||||
var ev = new IsTileSpaceMethodEvent(gridUid, mapUid, tile, mapGridComp);
|
||||
|
||||
@@ -178,7 +178,7 @@ public partial class AtmosphereSystem
|
||||
return ev.Result ?? Enumerable.Empty<GasMixture>();
|
||||
}
|
||||
|
||||
public void UpdateAdjacent(EntityUid gridUid, Vector2i tile, IMapGridComponent? mapGridComp = null)
|
||||
public void UpdateAdjacent(EntityUid gridUid, Vector2i tile, MapGridComponent? mapGridComp = null)
|
||||
{
|
||||
var ev = new UpdateAdjacentMethodEvent(gridUid, tile, mapGridComp);
|
||||
RaiseLocalEvent(gridUid, ref ev);
|
||||
@@ -263,10 +263,10 @@ public partial class AtmosphereSystem
|
||||
(EntityUid GridId, Vector2i Tile, ReactionResult Result = default, bool Handled = false);
|
||||
|
||||
[ByRefEvent] private record struct IsTileAirBlockedMethodEvent
|
||||
(EntityUid Grid, Vector2i Tile, AtmosDirection Direction = AtmosDirection.All, IMapGridComponent? MapGridComponent = null, bool Result = false, bool Handled = false);
|
||||
(EntityUid Grid, Vector2i Tile, AtmosDirection Direction = AtmosDirection.All, MapGridComponent? MapGridComponent = null, bool Result = false, bool Handled = false);
|
||||
|
||||
[ByRefEvent] private record struct IsTileSpaceMethodEvent
|
||||
(EntityUid? Grid, EntityUid? Map, Vector2i Tile, IMapGridComponent? MapGridComponent = null, bool Result = true, bool Handled = false);
|
||||
(EntityUid? Grid, EntityUid? Map, Vector2i Tile, MapGridComponent? MapGridComponent = null, bool Result = true, bool Handled = false);
|
||||
|
||||
[ByRefEvent] private record struct GetAdjacentTilesMethodEvent
|
||||
(EntityUid Grid, Vector2i Tile, IEnumerable<Vector2i>? Result = null, bool Handled = false);
|
||||
@@ -276,7 +276,7 @@ public partial class AtmosphereSystem
|
||||
IEnumerable<GasMixture>? Result = null, bool Handled = false);
|
||||
|
||||
[ByRefEvent] private record struct UpdateAdjacentMethodEvent
|
||||
(EntityUid Grid, Vector2i Tile, IMapGridComponent? MapGridComponent = null, bool Handled = false);
|
||||
(EntityUid Grid, Vector2i Tile, MapGridComponent? MapGridComponent = null, bool Handled = false);
|
||||
|
||||
[ByRefEvent] private record struct HotspotExposeMethodEvent
|
||||
(EntityUid Grid, Vector2i Tile, float ExposedTemperature, float ExposedVolume, bool soh, bool Handled = false);
|
||||
|
||||
@@ -72,7 +72,7 @@ public sealed partial class AtmosphereSystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TryComp(euid, out IMapGridComponent? gridComp))
|
||||
if (!TryComp(euid, out MapGridComponent? gridComp))
|
||||
{
|
||||
shell.WriteError($"Euid '{euid}' does not exist or is not a grid.");
|
||||
return;
|
||||
|
||||
@@ -43,7 +43,7 @@ public sealed partial class AtmosphereSystem
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
if (!TryComp(uid, out IMapGridComponent? mapGrid))
|
||||
if (!TryComp(uid, out MapGridComponent? mapGrid))
|
||||
return;
|
||||
|
||||
foreach (var (indices, tile) in gridAtmosphere.Tiles)
|
||||
@@ -324,7 +324,7 @@ public sealed partial class AtmosphereSystem
|
||||
|
||||
adjacent.BlockedAirflow = GetBlockedDirections(mapGridComp.Grid, adjacent.GridIndices);
|
||||
|
||||
// Pass in IMapGridComponent so we don't have to resolve it for every adjacent direction.
|
||||
// Pass in MapGridComponent so we don't have to resolve it for every adjacent direction.
|
||||
var tileBlockedEv = new IsTileAirBlockedMethodEvent(uid, tile.GridIndices, direction, mapGridComp);
|
||||
GridIsTileAirBlocked(uid, component, ref tileBlockedEv);
|
||||
|
||||
@@ -418,7 +418,7 @@ public sealed partial class AtmosphereSystem
|
||||
if (!adjEv.Handled || !component.Tiles.TryGetValue(args.Tile, out var tile))
|
||||
return;
|
||||
|
||||
if (!TryComp<IMapGridComponent>(uid, out var mapGridComp))
|
||||
if (!TryComp<MapGridComponent>(uid, out var mapGridComp))
|
||||
return;
|
||||
|
||||
var adjacent = adjEv.Result!.ToArray();
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
|
||||
var uid = atmosphere.Owner;
|
||||
|
||||
if (!TryComp(uid, out IMapGridComponent? mapGridComp))
|
||||
if (!TryComp(uid, out MapGridComponent? mapGridComp))
|
||||
return true;
|
||||
|
||||
var mapGrid = mapGridComp.Grid;
|
||||
@@ -161,7 +161,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
|
||||
var uid = atmosphere.Owner;
|
||||
|
||||
if (!TryComp(uid, out IMapGridComponent? mapGridComp))
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user