Class WorldSpatialQuery
- Namespace
- Shard.Gameplay.World
- Assembly
- Shard.Gameplay.World.dll
Provides synchronous point queries over explicitly enrolled World entities.
public sealed class WorldSpatialQuery
- Inheritance
-
WorldSpatialQuery
- Inherited Members
Remarks
Queries use the latest snapshot from the Index phase and exclude entities no longer loaded. Callbacks borrow Entity access only for the current synchronous World callback; do not retain it. Stable identity is optional. Membership changes become visible after reconciliation and Index. Spatial and membership mutations are forbidden during enumeration. Membership submission is also rejected after Index publishes the snapshot and before Cleanup. Submit membership changes on the owning World thread; await their reconciliation outside the callback.
Methods
EnrollAsync<TView>(Entity)
Queues membership for reconciliation before the next index rebuild.
public Task EnrollAsync<TView>(Entity entity) where TView : struct
Parameters
entityEntity
Returns
Type Parameters
TView
ForEachInBox<TView>(Vector3d, Vector3d, Action<Entity>)
Enumerates borrowed live entities in unspecified order inside the inclusive axis-aligned box.
public void ForEachInBox<TView>(Vector3d minimum, Vector3d maximum, Action<Entity> callback) where TView : struct
Parameters
Type Parameters
TView
ForEachInRadiusOrderedByDistance<TView>(Vector3d, double, Action<Entity>)
Enumerates borrowed live entities by ascending distance; order among equal distances is unspecified.
public void ForEachInRadiusOrderedByDistance<TView>(Vector3d center, double radius, Action<Entity> callback) where TView : struct
Parameters
Type Parameters
TView
ForEachInRadius<TView>(Vector3d, double, Action<Entity>)
Enumerates borrowed live entities in unspecified order on or inside the radius.
public void ForEachInRadius<TView>(Vector3d center, double radius, Action<Entity> callback) where TView : struct
Parameters
Type Parameters
TView
RegisterView<TView>(World)
Registers a marker type identifying a set of entities to query.
public static void RegisterView<TView>(World store) where TView : struct
Parameters
storeWorld
Type Parameters
TView
TryWithClosest<TView>(Vector3d, double, Action<Entity>)
Invokes the callback with the closest borrowed live entity inside the inclusive radius.
public bool TryWithClosest<TView>(Vector3d center, double radius, Action<Entity> callback) where TView : struct
Parameters
Returns
Type Parameters
TView
WithdrawAsync<TView>(Entity)
Queues membership removal for reconciliation before the next index rebuild.
public Task WithdrawAsync<TView>(Entity entity) where TView : struct
Parameters
entityEntity
Returns
Type Parameters
TView