Skip to content

Game.Simulation.RequestGroup

Assembly:
Assembly-CSharp (typical game/mod assembly; may also be present in the game's simulation assembly)

Namespace:
Game.Simulation

Type:
struct

Base:
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter

Summary:
RequestGroup is a lightweight ECS component used to store a count for a grouped request. It contains a single unsigned integer field representing the number of items in the group. As an IComponentData it can be attached to entities; implementing IQueryTypeParameter indicates it can be used in type-based queries or query-related APIs. This struct is blittable and suitable for use with Unity's ECS and Burst-compiled systems.


Fields

  • public System.UInt32 m_GroupCount
    Holds the number of items in the request group. Use this value to indicate the size of a grouped request or to control batching logic in systems that process entities carrying this component.

Properties

  • None.
    This type exposes its data via the public field m_GroupCount rather than properties.

Constructors

  • public RequestGroup(uint groupCount)
    Initializes a new RequestGroup instance and sets m_GroupCount to the provided groupCount.

Methods

  • None.
    This struct only stores data and does not define methods; behavior should be implemented in systems that read this component.

Usage Example

// Create and add the component to an entity
var group = new Game.Simulation.RequestGroup(4);
entityManager.AddComponentData(someEntity, group);

// Read the value in a SystemBase
protected override void OnUpdate()
{
    Entities
        .WithAll<Game.Simulation.RequestGroup>()
        .ForEach((ref Game.Simulation.RequestGroup rg) =>
        {
            uint count = rg.m_GroupCount;
            // process grouped request of 'count' items...
        }).Schedule();
}