Skip to content

Game.Simulation.TelecomStatus

Assembly: Assembly-CSharp (game runtime assembly)
Namespace: Game.Simulation

Type: struct

Base: System.ValueType

Summary:
TelecomStatus is a lightweight value-type container used by the simulation to represent the current state of a telecommunications service or subsystem. It holds basic numeric metrics — capacity, current load, and delivered quality — and is intended for fast, transient storage and passing of telecom-related simulation data.


Fields

  • public float m_Capacity
    Represents the total available telecom capacity (e.g., bandwidth or subscriber capacity) for the measured entity. Expected to be non-negative. When reading this value, guard against zero to avoid division-by-zero when computing utilization.

  • public float m_Load
    Current used portion of the capacity. Typical constraints: m_Load >= 0 and usually m_Load <= m_Capacity (but game code may allow transient values outside that range). Use this with m_Capacity to compute utilization or overload conditions.

  • public float m_Quality
    A normalized float representing delivered service quality. In practice this is typically in the range 0..1 (0 = no service, 1 = perfect service), though callers should not assume strict clamping unless documented elsewhere in the game code.

Properties

  • This struct defines no properties. All data is exposed via public fields.

Constructors

  • public TelecomStatus()
    Structs have an implicit default constructor that initializes all floats to 0.0f. You can also initialize via an object initializer: var s = new TelecomStatus { m_Capacity = 100f, m_Load = 20f, m_Quality = 0.95f };

Methods

  • This struct declares no methods. It's intended as a plain data container.

Usage Example

// basic initialization
var status = new Game.Simulation.TelecomStatus {
    m_Capacity = 100f,
    m_Load = 35f,
    m_Quality = 0.87f
};

// compute utilization safely
float utilization = (status.m_Capacity > 0f) ? (status.m_Load / status.m_Capacity) : 0f;

// check for overload
bool overloaded = status.m_Load > status.m_Capacity;

// passing by value (struct) — cheap to copy for small structs
ProcessTelecomStatus(status);

void ProcessTelecomStatus(Game.Simulation.TelecomStatus s)
{
    // s is a local copy; modifying s here won't affect the original variable
    // unless you explicitly return or use ref.
    if (s.m_Capacity > 0f)
    {
        float util = s.m_Load / s.m_Capacity;
        // ... do something with util and s.m_Quality
    }
}

Additional notes for modders: - Because TelecomStatus is a plain struct with public fields, it is efficient for frequent creation and passing in simulation loops. Be mindful of semantics when mutating: structs are value types and copies are made on assignment/passing-by-value. - Validate values (capacity > 0) before arithmetic operations. - If you need encapsulation or validation logic, wrap this struct in a class or create helper functions — but keep compatibility with existing game APIs if you are interacting with or replacing game data structures.