Content side for removing IMap / IMapGrid comps (#12357)

This commit is contained in:
metalgearsloth
2022-11-04 10:12:25 +11:00
committed by GitHub
parent 6d297fbb62
commit c0abea8047
30 changed files with 58 additions and 58 deletions

View File

@@ -112,7 +112,7 @@ public sealed partial class ShuttleSystem
/// <summary>
/// Checks whether the emergency shuttle can warp to the specified position.
/// </summary>
private bool ValidSpawn(IMapGridComponent grid, Box2 area)
private bool ValidSpawn(MapGridComponent grid, Box2 area)
{
return !grid.Grid.GetLocalTilesIntersecting(area).Any();
}
@@ -124,13 +124,13 @@ public sealed partial class ShuttleSystem
if (gridDocks.Count <= 0) return null;
var xformQuery = GetEntityQuery<TransformComponent>();
var targetGridGrid = Comp<IMapGridComponent>(targetGrid);
var targetGridGrid = Comp<MapGridComponent>(targetGrid);
var targetGridXform = xformQuery.GetComponent(targetGrid);
var targetGridAngle = targetGridXform.WorldRotation.Reduced();
var targetGridRotation = targetGridAngle.ToVec();
var shuttleDocks = GetDocks(component.Owner);
var shuttleAABB = Comp<IMapGridComponent>(component.Owner).Grid.LocalAABB;
var shuttleAABB = Comp<MapGridComponent>(component.Owner).Grid.LocalAABB;
var validDockConfigs = new List<DockingConfig>();
@@ -310,7 +310,7 @@ public sealed partial class ShuttleSystem
TransformComponent gridXform,
Vector2 targetGridRotation,
Box2 shuttleAABB,
IMapGridComponent grid,
MapGridComponent grid,
[NotNullWhen(true)] out Box2? shuttleDockedAABB,
out Matrix3 matty,
out Vector2 gridRotation)

View File

@@ -89,7 +89,7 @@ public sealed partial class ShuttleSystem
{
reason = null;
if (!TryComp<IMapGridComponent>(uid, out var grid) ||
if (!TryComp<MapGridComponent>(uid, out var grid) ||
!Resolve(uid.Value, ref xform))
{
return true;
@@ -226,7 +226,7 @@ public sealed partial class ShuttleSystem
comp.State = FTLState.Travelling;
var width = Comp<IMapGridComponent>(comp.Owner).Grid.LocalAABB.Width;
var width = Comp<MapGridComponent>(comp.Owner).Grid.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 +458,13 @@ public sealed partial class ShuttleSystem
}
var xformQuery = GetEntityQuery<TransformComponent>();
var shuttleAABB = Comp<IMapGridComponent>(component.Owner).Grid.LocalAABB;
var shuttleAABB = Comp<MapGridComponent>(component.Owner).Grid.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<IMapGridComponent>(targetUid).Grid.LocalAABB).Enlarged(shuttleAABB.Size.Length);
.TransformBox(Comp<MapGridComponent>(targetUid).Grid.LocalAABB).Enlarged(shuttleAABB.Size.Length);
var nearbyGrids = new HashSet<EntityUid>(1) { targetUid };
var iteration = 0;
@@ -478,7 +478,7 @@ public sealed partial class ShuttleSystem
if (!nearbyGrids.Add(grid.GridEntityId)) continue;
targetAABB = targetAABB.Union(_transform.GetWorldMatrix(grid.GridEntityId, xformQuery)
.TransformBox(Comp<IMapGridComponent>(grid.GridEntityId).Grid.LocalAABB));
.TransformBox(Comp<MapGridComponent>(grid.GridEntityId).Grid.LocalAABB));
}
// Can do proximity
@@ -501,7 +501,7 @@ public sealed partial class ShuttleSystem
if (nearbyGrids.Contains(grid.GridEntityId)) continue;
targetAABB = targetAABB.Union(_transform.GetWorldMatrix(grid.GridEntityId, xformQuery)
.TransformBox(Comp<IMapGridComponent>(grid.GridEntityId).Grid.LocalAABB));
.TransformBox(Comp<MapGridComponent>(grid.GridEntityId).Grid.LocalAABB));
}
break;

View File

@@ -102,7 +102,7 @@ namespace Content.Server.Shuttles.Systems
private void OnShuttleStartup(EntityUid uid, ShuttleComponent component, ComponentStartup args)
{
if (!EntityManager.HasComponent<IMapGridComponent>(component.Owner))
if (!EntityManager.HasComponent<MapGridComponent>(component.Owner))
{
return;
}