address all reviews
This commit is contained in:
@@ -124,9 +124,9 @@ namespace Content.Shared.Maps
|
||||
/// Helper that returns all entities in a turf.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static IEnumerable<IEntity> GetEntitiesInTile(this TileRef turf, bool approximate = false)
|
||||
public static IEnumerable<IEntity> GetEntitiesInTile(this TileRef turf, bool approximate = false, IEntityManager? entityManager = null)
|
||||
{
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
entityManager ??= IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
return entityManager.GetEntitiesIntersecting(turf.MapIndex, GetWorldTileBox(turf), approximate);
|
||||
}
|
||||
@@ -134,27 +134,27 @@ namespace Content.Shared.Maps
|
||||
/// <summary>
|
||||
/// Helper that returns all entities in a turf.
|
||||
/// </summary>
|
||||
public static IEnumerable<IEntity> GetEntitiesInTile(this EntityCoordinates coordinates, bool approximate = false)
|
||||
public static IEnumerable<IEntity> GetEntitiesInTile(this EntityCoordinates coordinates, bool approximate = false, IEntityManager? entityManager = null)
|
||||
{
|
||||
var turf = coordinates.GetTileRef();
|
||||
|
||||
if (turf == null)
|
||||
return Enumerable.Empty<IEntity>();
|
||||
|
||||
return GetEntitiesInTile(turf.Value);
|
||||
return GetEntitiesInTile(turf.Value, approximate, entityManager);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper that returns all entities in a turf.
|
||||
/// </summary>
|
||||
public static IEnumerable<IEntity> GetEntitiesInTile(this MapIndices indices, GridId gridId, bool approximate = false)
|
||||
public static IEnumerable<IEntity> GetEntitiesInTile(this MapIndices indices, GridId gridId, bool approximate = false, IEntityManager? entityManager = null)
|
||||
{
|
||||
var turf = indices.GetTileRef(gridId);
|
||||
|
||||
if (turf == null)
|
||||
return Enumerable.Empty<IEntity>();
|
||||
|
||||
return GetEntitiesInTile(turf.Value);
|
||||
return GetEntitiesInTile(turf.Value, approximate, entityManager);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user