Skip to content

Game.Prefabs.InfoviewBuildingStatusData

Assembly:
Assembly-CSharp (game "Game" assembly; type defined in the game's main code)

Namespace:
Game.Prefabs

Type:
struct

Base:
IComponentData, IQueryTypeParameter

Summary:
A small ECS component used by the Infoview / UI systems to represent a building-related status and an associated spatial range. It is a plain value type (struct) intended to be attached to entities so systems can query for which buildings or UI markers should show a specific status within a given area. The struct implements IComponentData to be usable in Unity's DOTS/ECS and IQueryTypeParameter to allow it to be used as a query parameter in Entities queries.


Fields

  • public BuildingStatusType m_Type
    Holds the type of building status this component represents. BuildingStatusType is an enum (defined elsewhere in the codebase) identifying the specific status category (for example, types used by the Infoview system such as service coverage, issues, events, etc.). Check the enum definition for the complete list of status values.

  • public Bounds1 m_Range
    Represents the spatial range or bounding shape associated with this status. Bounds1 is a struct from Colossal.Mathematics used by the game's systems to describe a bounding region (see Colossal.Mathematics for exact field layout and semantics). This field is used to determine the area of influence or visibility for the status (for example, coverage radius, effect area, or UI highlight bounds).

Properties

  • This type has no properties; it exposes two public fields.

Constructors

  • public InfoviewBuildingStatusData()
    No explicit constructors are defined in the source; the default value-type constructor applies. Initialize values directly when creating instances. Example:
  • m_Type should be set to a valid BuildingStatusType value.
  • m_Range should be constructed/assigned using an appropriate Bounds1 factory or constructor (see Colossal.Mathematics.Bounds1).

Methods

  • This struct defines no methods.

Usage Example

Example 1 — creating and adding the component to an entity via EntityManager:

// Create the component with desired values
var status = new InfoviewBuildingStatusData
{
    m_Type = BuildingStatusType.ServiceCoverage, // example enum value
    m_Range = new Bounds1(center, radius)        // construct Bounds1 appropriately
};

// Add to an existing entity
entityManager.AddComponentData(someEntity, status);

Example 2 — using the component in a SystemBase/Entities query:

public partial class InfoviewStatusSystem : SystemBase
{
    protected override void OnUpdate()
    {
        // Query for entities that have InfoviewBuildingStatusData and process them
        Entities
            .WithAll<InfoviewBuildingStatusData>()
            .ForEach((in InfoviewBuildingStatusData status, in Translation pos) =>
            {
                // Use status.m_Type and status.m_Range to update UI or perform logic
            }).ScheduleParallel();
    }
}

Notes and tips: - Because this is an IComponentData struct, it is copied by value — keep it small and avoid adding large nested structures. - Bounds1 comes from Colossal.Mathematics; consult that type's definition for how to construct and interpret ranges correctly (center, extents, radius, etc.). - BuildingStatusType is an enum defined elsewhere — use those predefined values for consistency with the game's Infoview systems. - IQueryTypeParameter enables flexible use in queries; this type can be used directly in query signatures to filter or fetch data.