Class GridScanManager
Provides efficient querying methods for retrieving occupants within a grid. Handles spatial lookups for voxels, filtering by occupant type, and fetching occupants using unique tickets.
public static class GridScanManager
- Inheritance
-
GridScanManager
- Inherited Members
Methods
GetConditionalOccupants(GridWorld, WorldVoxelIndex, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Retrieves occupants whose group Ids match a given condition at a world-scoped voxel identity in the supplied world.
public static IEnumerable<IVoxelOccupant> GetConditionalOccupants(GridWorld world, WorldVoxelIndex index, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null)
Parameters
worldGridWorldindexWorldVoxelIndexoccupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
Returns
GetConditionalOccupants(VoxelGrid, Vector3d, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Retrieves occupants whose group Ids match a given condition.
public static IEnumerable<IVoxelOccupant> GetConditionalOccupants(this VoxelGrid grid, Vector3d position, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null)
Parameters
gridVoxelGridpositionVector3doccupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
Returns
GetConditionalOccupants(VoxelGrid, Voxel, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Retrieves occupants at a given voxel that match a specified group condition.
public static IEnumerable<IVoxelOccupant> GetConditionalOccupants(this VoxelGrid grid, Voxel targetVoxel, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null)
Parameters
gridVoxelGridtargetVoxelVoxeloccupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
Returns
GetConditionalOccupants(VoxelGrid, VoxelIndex, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Retrieves occupants whose group Ids match a given condition.
public static IEnumerable<IVoxelOccupant> GetConditionalOccupants(this VoxelGrid grid, VoxelIndex index, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null)
Parameters
gridVoxelGridindexVoxelIndexoccupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
Returns
GetOccupants(GridWorld, WorldVoxelIndex)
Retrieves all occupants at a given world-scoped voxel identity in the supplied world.
public static IEnumerable<IVoxelOccupant> GetOccupants(GridWorld world, WorldVoxelIndex index)
Parameters
worldGridWorldindexWorldVoxelIndex
Returns
GetOccupants(VoxelGrid, Vector3d)
Retrieves all occupants at a given world position within the grid.
public static IEnumerable<IVoxelOccupant> GetOccupants(this VoxelGrid grid, Vector3d position)
Parameters
gridVoxelGridpositionVector3d
Returns
GetOccupants(VoxelGrid, Voxel)
Retrieves all occupants at a given voxel.
public static IEnumerable<IVoxelOccupant> GetOccupants(this VoxelGrid grid, Voxel voxel)
Parameters
Returns
GetOccupants(VoxelGrid, VoxelIndex)
Retrieves all occupants at a given voxel coordinate within the grid.
public static IEnumerable<IVoxelOccupant> GetOccupants(this VoxelGrid grid, VoxelIndex index)
Parameters
gridVoxelGridindexVoxelIndex
Returns
GetVoxelOccupantsByType<T>(GridWorld, WorldVoxelIndex)
Retrieves all occupants of a specific type at a given world-scoped voxel identity in the supplied world.
public static IEnumerable<T> GetVoxelOccupantsByType<T>(GridWorld world, WorldVoxelIndex index) where T : IVoxelOccupant
Parameters
worldGridWorldindexWorldVoxelIndex
Returns
- IEnumerable<T>
Type Parameters
T
GetVoxelOccupantsByType<T>(VoxelGrid, Vector3d)
Retrieves all occupants of a specific type at a given world position.
public static IEnumerable<T> GetVoxelOccupantsByType<T>(this VoxelGrid grid, Vector3d position) where T : IVoxelOccupant
Parameters
gridVoxelGridpositionVector3d
Returns
- IEnumerable<T>
Type Parameters
T
GetVoxelOccupantsByType<T>(VoxelGrid, Voxel)
Retrieves all occupants of a specific type at a given voxel.
public static IEnumerable<T> GetVoxelOccupantsByType<T>(this VoxelGrid grid, Voxel voxel) where T : IVoxelOccupant
Parameters
Returns
- IEnumerable<T>
Type Parameters
T
GetVoxelOccupantsByType<T>(VoxelGrid, VoxelIndex)
Retrieves all occupants of a specific type at a given voxel coordinate.
public static IEnumerable<T> GetVoxelOccupantsByType<T>(this VoxelGrid grid, VoxelIndex index) where T : IVoxelOccupant
Parameters
gridVoxelGridindexVoxelIndex
Returns
- IEnumerable<T>
Type Parameters
T
ScanRadius(GridWorld, Vector2d, Fixed64, Fixed64, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Scans for occupants within a 2D XZ radius on the supplied world Y layer.
public static IEnumerable<IVoxelOccupant> ScanRadius(GridWorld world, Vector2d position, Fixed64 radius, Fixed64 layerY = default, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null)
Parameters
worldGridWorldpositionVector2dradiusFixed64layerYFixed64occupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
Returns
ScanRadius(GridWorld, Vector3d, Fixed64, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Scans for occupants within a given radius from a specified position in the supplied world.
public static IEnumerable<IVoxelOccupant> ScanRadius(GridWorld world, Vector3d position, Fixed64 radius, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null)
Parameters
worldGridWorldpositionVector3dradiusFixed64occupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
Returns
ScanRadiusInto(GridWorld, Vector2d, Fixed64, SwiftList<IVoxelOccupant>, Fixed64, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Clears and fills caller-owned storage with occupants within a 2D XZ radius on the supplied world Y layer.
public static void ScanRadiusInto(GridWorld world, Vector2d position, Fixed64 radius, SwiftList<IVoxelOccupant> results, Fixed64 layerY = default, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null)
Parameters
worldGridWorldpositionVector2dradiusFixed64resultsSwiftList<IVoxelOccupant>layerYFixed64occupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
ScanRadiusInto(GridWorld, Vector2d, Fixed64, SwiftList<IVoxelOccupant>, GridScanScratch, Fixed64, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Clears and fills caller-owned storage using caller-owned scratch collections for a 2D XZ radius.
public static void ScanRadiusInto(GridWorld world, Vector2d position, Fixed64 radius, SwiftList<IVoxelOccupant> results, GridScanScratch scratch, Fixed64 layerY = default, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null)
Parameters
worldGridWorldpositionVector2dradiusFixed64resultsSwiftList<IVoxelOccupant>scratchGridScanScratchlayerYFixed64occupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
ScanRadiusInto(GridWorld, Vector3d, Fixed64, SwiftList<IVoxelOccupant>, GridScanScratch, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Clears and fills caller-owned storage using caller-owned scratch collections.
public static void ScanRadiusInto(GridWorld world, Vector3d position, Fixed64 radius, SwiftList<IVoxelOccupant> results, GridScanScratch scratch, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null)
Parameters
worldGridWorldpositionVector3dradiusFixed64resultsSwiftList<IVoxelOccupant>scratchGridScanScratchoccupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
ScanRadiusInto(GridWorld, Vector3d, Fixed64, SwiftList<IVoxelOccupant>, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Clears and fills caller-owned storage with occupants within the supplied radius.
public static void ScanRadiusInto(GridWorld world, Vector3d position, Fixed64 radius, SwiftList<IVoxelOccupant> results, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null)
Parameters
worldGridWorldpositionVector3dradiusFixed64resultsSwiftList<IVoxelOccupant>occupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
ScanRadiusInto<T>(GridWorld, Vector2d, Fixed64, SwiftList<T>, Fixed64, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Clears and fills caller-owned typed storage with occupants within a 2D XZ radius on the supplied world Y layer.
public static void ScanRadiusInto<T>(GridWorld world, Vector2d position, Fixed64 radius, SwiftList<T> results, Fixed64 layerY = default, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null) where T : IVoxelOccupant
Parameters
worldGridWorldpositionVector2dradiusFixed64resultsSwiftList<T>layerYFixed64occupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
Type Parameters
T
ScanRadiusInto<T>(GridWorld, Vector2d, Fixed64, SwiftList<T>, GridScanScratch, Fixed64, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Clears and fills caller-owned typed storage using caller-owned scratch collections for a 2D XZ radius.
public static void ScanRadiusInto<T>(GridWorld world, Vector2d position, Fixed64 radius, SwiftList<T> results, GridScanScratch scratch, Fixed64 layerY = default, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null) where T : IVoxelOccupant
Parameters
worldGridWorldpositionVector2dradiusFixed64resultsSwiftList<T>scratchGridScanScratchlayerYFixed64occupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
Type Parameters
T
ScanRadiusInto<T>(GridWorld, Vector3d, Fixed64, SwiftList<T>, GridScanScratch, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Clears and fills caller-owned typed storage using caller-owned scratch collections.
public static void ScanRadiusInto<T>(GridWorld world, Vector3d position, Fixed64 radius, SwiftList<T> results, GridScanScratch scratch, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null) where T : IVoxelOccupant
Parameters
worldGridWorldpositionVector3dradiusFixed64resultsSwiftList<T>scratchGridScanScratchoccupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
Type Parameters
T
ScanRadiusInto<T>(GridWorld, Vector3d, Fixed64, SwiftList<T>, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Clears and fills caller-owned storage with typed occupants within the supplied radius.
public static void ScanRadiusInto<T>(GridWorld world, Vector3d position, Fixed64 radius, SwiftList<T> results, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null) where T : IVoxelOccupant
Parameters
worldGridWorldpositionVector3dradiusFixed64resultsSwiftList<T>occupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
Type Parameters
T
ScanRadius<T>(GridWorld, Vector2d, Fixed64, Fixed64, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Scans for occupants of a specific type within a 2D XZ radius on the supplied world Y layer.
public static IEnumerable<T> ScanRadius<T>(GridWorld world, Vector2d position, Fixed64 radius, Fixed64 layerY = default, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null) where T : IVoxelOccupant
Parameters
worldGridWorldpositionVector2dradiusFixed64layerYFixed64occupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
Returns
- IEnumerable<T>
Type Parameters
T
ScanRadius<T>(GridWorld, Vector3d, Fixed64, Func<IVoxelOccupant, bool>?, Func<byte, bool>?)
Scans for occupants of a specific type within a given radius in the supplied world.
public static IEnumerable<T> ScanRadius<T>(GridWorld world, Vector3d position, Fixed64 radius, Func<IVoxelOccupant, bool>? occupantCondition = null, Func<byte, bool>? groupCondition = null) where T : IVoxelOccupant
Parameters
worldGridWorldpositionVector3dradiusFixed64occupantConditionFunc<IVoxelOccupant, bool>groupConditionFunc<byte, bool>
Returns
- IEnumerable<T>
Type Parameters
T
TryGetVoxelOccupant(GridWorld, WorldVoxelIndex, OccupantTicket, out IVoxelOccupant?)
Retrieves a specific occupant at a given world-scoped voxel identity using an occupant ticket in the supplied world.
public static bool TryGetVoxelOccupant(GridWorld world, WorldVoxelIndex index, OccupantTicket ticket, out IVoxelOccupant? occupant)
Parameters
worldGridWorldindexWorldVoxelIndexticketOccupantTicketoccupantIVoxelOccupant
Returns
TryGetVoxelOccupant(VoxelGrid, Vector3d, OccupantTicket, out IVoxelOccupant?)
Retrieves a specific occupant at a given world position using an occupant ticket.
public static bool TryGetVoxelOccupant(this VoxelGrid grid, Vector3d position, OccupantTicket ticket, out IVoxelOccupant? occupant)
Parameters
gridVoxelGridpositionVector3dticketOccupantTicketoccupantIVoxelOccupant
Returns
TryGetVoxelOccupant(VoxelGrid, Voxel, OccupantTicket, out IVoxelOccupant?)
Retrieves a specific occupant from a given voxel using an occupant ticket.
public static bool TryGetVoxelOccupant(this VoxelGrid grid, Voxel voxel, OccupantTicket ticket, out IVoxelOccupant? occupant)
Parameters
gridVoxelGridvoxelVoxelticketOccupantTicketoccupantIVoxelOccupant
Returns
TryGetVoxelOccupant(VoxelGrid, VoxelIndex, OccupantTicket, out IVoxelOccupant?)
Retrieves a specific occupant at a given voxel coordinate using an occupant ticket.
public static bool TryGetVoxelOccupant(this VoxelGrid grid, VoxelIndex index, OccupantTicket ticket, out IVoxelOccupant? occupant)
Parameters
gridVoxelGridindexVoxelIndexticketOccupantTicketoccupantIVoxelOccupant