mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-06 17:58:05 +02:00
Removes IMapManager (#6584)
* Move MapManager queries to SharedMapSystem Moves all variants of FindGridsIntersecting/TryFindGridAt to SharedMapSystem Hollows out the MapManager methods and converts them into relays to SharedMapSystem * Move CreateGrid to SharedMapSystem Moves the functionality for CreateGrid and its variants to SharedMapSystem Hollows out the MapManager methods and converts them into relays for the SharedMapSystem methods Obsoletes them too Also moves over the GetAllMapGrids and GetAllGrids methods * Move RaiseOnTileChanged to SharedMapSystem Also moves the SuppressOnTileChanged flag member to SharedMapSystem Hollows out and obsoletes the MapManager versions * Move default value constants to SharedMapSystem * Converts map pausing events into LocalizedEntityCommands * Move MapManager related delegates/structs to SharedMapSystem Moves the GridCreationOptions struct to the same namespace as SharedMapSystem and converts it into a record struct Move the GridCallback delegates to the same namespace as SharedMapSystem * Move CullDeletionHistory to SharedMapSystem Well, that was less painful than I thought it would be * Actually obsolete the NetworkedMapManager method * Rename file * Doc comments for new SharedMapSystem methods * Doc comment * Doc comments * Fix access * Purge all references to IMapManagerInternal * Cull easy IMapManager references * The rest * Purge IMapManager * Private internal FindGridsIntersecting method * please die * 41 * notes --------- Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
This commit is contained in:
co-authored by
ArtisticRoomba
parent
e3851fa310
commit
f2625bf5c5
@@ -283,7 +283,7 @@ public abstract partial class SharedTransformSystem
|
||||
// Entity may not be directly parented to the grid (e.g., spawned using some relative entity coordinates)
|
||||
// in that case, we attempt to attach to a grid.
|
||||
var pos = new MapCoordinates(GetWorldPosition(component), component.MapID);
|
||||
if (_mapManager.TryFindGridAt(pos, out var gridUid, out gridComp))
|
||||
if (_map.TryFindGridAt(pos, out var gridUid, out gridComp))
|
||||
grid = (gridUid, gridComp);
|
||||
}
|
||||
|
||||
@@ -1016,7 +1016,7 @@ public abstract partial class SharedTransformSystem
|
||||
{
|
||||
var mapUid = _map.GetMap(coordinates.MapId);
|
||||
if (!_gridQuery.HasComponent(entity) &&
|
||||
_mapManager.TryFindGridAt(mapUid, coordinates.Position, out var targetGrid, out _))
|
||||
_map.TryFindGridAt(mapUid, coordinates.Position, out var targetGrid, out _))
|
||||
{
|
||||
var invWorldMatrix = GetInvWorldMatrix(targetGrid);
|
||||
SetCoordinates((entity.Owner, entity.Comp, MetaData(entity.Owner)), new EntityCoordinates(targetGrid, Vector2.Transform(coordinates.Position, invWorldMatrix)));
|
||||
@@ -1259,7 +1259,7 @@ public abstract partial class SharedTransformSystem
|
||||
return;
|
||||
}
|
||||
|
||||
if (component.GridUid != uid && _mapManager.TryFindGridAt(component.MapUid.Value, worldPos, out var targetGrid, out _))
|
||||
if (component.GridUid != uid && _map.TryFindGridAt(component.MapUid.Value, worldPos, out var targetGrid, out _))
|
||||
{
|
||||
var targetGridXform = XformQuery.GetComponent(targetGrid);
|
||||
var invLocalMatrix = targetGridXform.InvLocalMatrix;
|
||||
@@ -1513,7 +1513,7 @@ public abstract partial class SharedTransformSystem
|
||||
return false;
|
||||
|
||||
var oldPos = GetWorldPosition(xform);
|
||||
if (_mapManager.TryFindGridAt(map, oldPos, out var gridUid, out _) && !TerminatingOrDeleted(gridUid))
|
||||
if (_map.TryFindGridAt(map, oldPos, out var gridUid, out _) && !TerminatingOrDeleted(gridUid))
|
||||
{
|
||||
coordinates = gridUid == xform.ParentUid
|
||||
? new EntityCoordinates(gridUid, xform.LocalPosition)
|
||||
@@ -1773,7 +1773,7 @@ public abstract partial class SharedTransformSystem
|
||||
{
|
||||
var mapUid = _map.GetMapOrInvalid(pos2.Value.MapId);
|
||||
|
||||
if (!_gridQuery.HasComponent(entity1) && _mapManager.TryFindGridAt(mapUid, pos2.Value.Position, out var targetGrid, out _))
|
||||
if (!_gridQuery.HasComponent(entity1) && _map.TryFindGridAt(mapUid, pos2.Value.Position, out var targetGrid, out _))
|
||||
{
|
||||
var invWorldMatrix = GetInvWorldMatrix(targetGrid);
|
||||
SetCoordinates(entity1, new EntityCoordinates(targetGrid, Vector2.Transform(pos2.Value.Position, invWorldMatrix)));
|
||||
@@ -1796,7 +1796,7 @@ public abstract partial class SharedTransformSystem
|
||||
{
|
||||
var mapUid = _map.GetMapOrInvalid(pos1.Value.MapId);
|
||||
|
||||
if (!_gridQuery.HasComponent(entity1) && _mapManager.TryFindGridAt(mapUid, pos1.Value.Position, out var targetGrid, out _))
|
||||
if (!_gridQuery.HasComponent(entity1) && _map.TryFindGridAt(mapUid, pos1.Value.Position, out var targetGrid, out _))
|
||||
{
|
||||
var invWorldMatrix = GetInvWorldMatrix(targetGrid);
|
||||
SetCoordinates(entity2, new EntityCoordinates(targetGrid, Vector2.Transform(pos1.Value.Position, invWorldMatrix)));
|
||||
|
||||
Reference in New Issue
Block a user