EntityQuery.Random Method
Definition
Namespace: Brine2D.ECS.Query
| Overloads | |
|---|---|
| Random() | Executes the query and returns a single random matching entity, or null. |
| Random\(int\) | Executes the query and returns N random matching entities. |
EntityQuery.Random() Method
Executes the query and returns a single random matching entity, or null.
Returns
Remarks
Uses reservoir sampling to avoid materializing the full result set.
EntityQuery.Random\(int\) Method
Executes the query and returns N random matching entities.
Parameters
count System.Int32
Returns
System.Collections.Generic.List<Entity>
Remarks
Uses reservoir sampling \(Algorithm R\) to select a uniformly random subset without materializing the full result set.