Game.Prefabs.NetEdgeStateInfo
Assembly:
Assembly-CSharp (game runtime assembly; typical for Cities: Skylines 2 game code)
Namespace:
Game.Prefabs
Type:
class
Base:
System.Object
Summary:
Serializable container class that describes conditional requirements and resulting state changes for a network "edge" (net piece/segment) within a prefab. It holds multiple sets of NetPieceRequirements that drive whether a given state should be applied to an edge: which requirements must all be true, which requirements any may satisfy, which must be absent, and which requirements to set when the state is applied. This is typically used by net prefabs to define dynamic state transitions or conditional visuals/logic for network pieces.
Fields
-
public NetPieceRequirements[] m_RequireAll
Array of requirements where every listed requirement must be satisfied for the state condition to be considered met. Use this to require a conjunction of conditions. -
public NetPieceRequirements[] m_RequireAny
Array of requirements where at least one requirement must be satisfied for the condition to pass. Use this to express alternative acceptable requirements. -
public NetPieceRequirements[] m_RequireNone
Array of requirements that must all be NOT present (i.e., none of them are allowed). Use this to explicitly exclude states or flags. -
public NetPieceRequirements[] m_SetState
Array of requirements/state flags that should be set (applied) to the net piece when the condition is satisfied. This defines the resulting state changes.
Notes: - NetPieceRequirements is a separate type (not defined here) that typically encodes a condition or a state flag for a net piece (for example: a particular piece variant, a directional flag, or other custom requirement). Consult the NetPieceRequirements definition for fields and semantics. - All fields are public arrays and marked up by the [Serializable] attribute on the class, so they are intended to be serialized with the prefab data (e.g., saved/loaded with assets or scene data).
Properties
- This class does not define any C# properties; it exposes its data via public fields.
Constructors
public NetEdgeStateInfo()
Default constructor (auto-generated). The class relies on the default parameterless constructor; arrays will be null until populated. When constructing manually, initialize arrays as needed (e.g., new NetPieceRequirements[0] or populate with elements).
Methods
- This class declares no methods. It is a plain data container used by other systems (prefab loaders, state evaluators) that perform the logic of evaluating requirements and applying states.
Usage Example
// Create a NetEdgeStateInfo instance and populate it manually.
var stateInfo = new Game.Prefabs.NetEdgeStateInfo
{
m_RequireAll = new [] {
new NetPieceRequirements { /* fill requirement data */ }
},
m_RequireAny = new NetPieceRequirements[0], // none
m_RequireNone = new [] {
new NetPieceRequirements { /* requirement that must NOT be present */ }
},
m_SetState = new [] {
new NetPieceRequirements { /* state flags to apply when requirements met */ }
}
};
// Typical use: a prefab/state-evaluation routine would examine the arrays,
// test the current piece state against m_RequireAll / m_RequireAny / m_RequireNone,
// and if satisfied, apply the flags listed in m_SetState to the piece.
Additional tips for modders: - Because fields are public and the class is serializable, you can create and serialize instances in custom prefab data or read these arrays from existing prefabs to understand the game's conditional net behavior. - Always check for null arrays when reading or manipulating instances (they may be null if not initialized). - Inspect NetPieceRequirements to understand how to construct valid requirement entries (IDs, flags, masks, etc.).