Skip to content

Game.Prefabs.InfoviewNetStatusData

Assembly:
Game (inferred from namespace; the concrete assembly name may be Assembly-CSharp or a game-specific assembly in the Cities: Skylines 2 mod project)

Namespace:
Game.Prefabs

Type:
struct

Base:
IComponentData, IQueryTypeParameter

Summary:
A lightweight ECS component used by the game's infoview overlay systems to describe how network (road/track/etc.) status should be visualized. Contains the status type to display, a numeric range used for filtering/measurement, and a tiling value used for texture/visual repetition. Implementing IComponentData makes it suitable to attach to Entities; IQueryTypeParameter indicates it can be used directly in queries for systems or rendering jobs.


Fields

  • public NetStatusType m_Type
    Describes which network status category this component represents (for example, traffic level, condition, capacity, etc.). NetStatusType is an enum (defined elsewhere in the codebase/game API) used by the infoview rendering logic to pick color/visuals.

  • public Bounds1 m_Range
    A one-dimensional bounds/range value from Colossal.Mathematics. Used to constrain or map values (for example, min/max thresholds for coloration or to compute normalized values). Check Colossal.Mathematics.Bounds1 API for exact semantics (it typically represents a numeric interval).

  • public float m_Tiling
    A floating-point tiling/scaling factor applied by the visualization (commonly used to repeat or scale overlay textures or patterns along the network).

Properties

  • None.
    This struct exposes only public fields and relies on default value semantics. There are no C# properties defined.

Constructors

  • None explicitly defined.
    The type uses the default parameterless struct constructor provided by C#. Initialize fields directly when creating the component or via SetComponentData on an Entity.

Methods

  • None.
    This is a plain data container (POD) with no behavior methods. Any processing is done by systems that read this component.

Usage Example

// Example: create an entity and assign InfoviewNetStatusData in a system or initialization code.

using Unity.Entities;
using Game.Prefabs;
using Colossal.Mathematics;

public void CreateInfoviewEntity(EntityManager em)
{
    var archetype = em.CreateArchetype(typeof(InfoviewNetStatusData));
    Entity e = em.CreateEntity(archetype);

    var data = new InfoviewNetStatusData
    {
        m_Type = NetStatusType.Traffic,   // example enum value; replace with actual enum member
        m_Range = new Bounds1(0f, 100f),  // construct according to Bounds1 API (min, max or center/extent)
        m_Tiling = 1.0f
    };

    em.SetComponentData(e, data);
}

Notes and tips: - Because this struct is an IComponentData, prefer using EntityManager/EntityCommandBuffer or authoring components to add it to Entities. - Inspect the definitions of NetStatusType and Bounds1 in the game API for the exact enum members and Bounds1 constructors/properties to ensure correct initialization and interpretation of range values. - Keep the struct as a plain data container to remain efficient in DOTS/ECS systems — avoid adding managed types or logic.