mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Struct enumerator for GetAllGrids (#2624)
This commit is contained in:
@@ -116,9 +116,20 @@ internal partial class MapManager
|
||||
OnGridCreated?.Invoke(mapGrid.ParentMapId, mapGrid.Index);
|
||||
}
|
||||
|
||||
public GridEnumerator GetAllGridsEnumerator()
|
||||
{
|
||||
var query = EntityManager.GetEntityQuery<MapGridComponent>();
|
||||
return new GridEnumerator(_grids.GetEnumerator(), query);
|
||||
}
|
||||
|
||||
public IEnumerable<IMapGrid> GetAllGrids()
|
||||
{
|
||||
return EntityManager.EntityQuery<IMapGridComponent>(true).Select(c => c.Grid);
|
||||
var compQuery = EntityManager.GetEntityQuery<MapGridComponent>();
|
||||
|
||||
foreach (var (_, uid) in _grids)
|
||||
{
|
||||
yield return compQuery.GetComponent(uid).Grid;
|
||||
}
|
||||
}
|
||||
|
||||
public IMapGrid CreateGrid(MapId currentMapId, GridId? forcedGridId = null, ushort chunkSize = 16)
|
||||
|
||||
Reference in New Issue
Block a user