* Engine namespace changes.
* Automated remove redundant using statements.
* Simplified Graphics namespace.
* Apparently the container system stores full type names in the map file.😞 This updates those names.
* API Changes to LocalizationManager.LoadCulture.
* Update submodule to v0.3.2
35 lines
1.2 KiB
C#
35 lines
1.2 KiB
C#
#nullable enable
|
|
using System.Collections.Generic;
|
|
using System.Runtime.CompilerServices;
|
|
using Robust.Server.GameObjects;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Maths;
|
|
|
|
namespace Content.Server.Utility
|
|
{
|
|
public static class GridTileLookupHelpers
|
|
{
|
|
/// <summary>
|
|
/// Helper that returns all entities in a turf very fast.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static IEnumerable<IEntity> GetEntitiesInTileFast(this TileRef turf, GridTileLookupSystem? gridTileLookup = null)
|
|
{
|
|
gridTileLookup ??= EntitySystem.Get<GridTileLookupSystem>();
|
|
|
|
return gridTileLookup.GetEntitiesIntersecting(turf.GridIndex, turf.GridIndices);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Helper that returns all entities in a turf.
|
|
/// </summary>
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public static IEnumerable<IEntity> GetEntitiesInTileFast(this Vector2i indices, GridId gridId, GridTileLookupSystem? gridTileLookup = null)
|
|
{
|
|
gridTileLookup ??= EntitySystem.Get<GridTileLookupSystem>();
|
|
return gridTileLookup.GetEntitiesIntersecting(gridId, indices);
|
|
}
|
|
}
|
|
}
|