Game.CutElementRef
Assembly: Assembly-CSharp.dll
Namespace: Game.Simulation.Flow
Type: struct
Base: System.ValueType
Summary:
Represents a lightweight value-type reference to a "cut element" used by the flow/cutting simulation. The struct stores three integer fields: the layer the element belongs to, the element index, and a link to the next element index. It's intended for compact storage (e.g., arrays) and fast value semantics within the simulation.
Fields
-
public int m_Layer
Index or identifier of the layer this cut element belongs to. Used to partition elements into different layers or categories within the flow system. -
public int m_Index
The index (identifier) of this cut element within whatever container/array the simulation uses. -
public int m_NextIndex
Index of the next cut element in a chain/list (or -1 / sentinel when there is no next). Used to form linked lists of elements without extra allocations.
Properties
- None (this type exposes public fields directly).
This struct uses public fields for minimal overhead. There are no computed properties or accessors defined.
Constructors
public CutElementRef()
Implicit default constructor (value-type). All integer fields default to 0. If you need a specific sentinel for "no next", set m_NextIndex explicitly (e.g., -1).
(There is no explicit parameterized constructor defined in the source; you can create helper constructors in user code if desired.)
Methods
- None (no methods implemented on this struct).
This type is a plain data container; any operations (comparison, linking, validation) are expected to be implemented by the surrounding simulation code.
Usage Example
// Create and initialize a CutElementRef
var element = new Game.Simulation.Flow.CutElementRef
{
m_Layer = 2,
m_Index = 42,
m_NextIndex = -1 // use -1 (or another sentinel) to mark end of chain
};
// Link elements in an array-backed chain
CutElementRef[] elements = new CutElementRef[100];
elements[42] = element;
elements[43].m_Layer = 2;
elements[42].m_NextIndex = 43;
// Read values
int layer = elements[42].m_Layer;
int next = elements[42].m_NextIndex;
Additional notes: - Being a struct (value type), assignments and array storage copy the fields; be mindful when mutating copies. - Use a sentinel (commonly -1) for m_NextIndex to indicate "no next" unless the simulation specifies another convention. - This type is optimized for low-allocation/high-performance patterns common in simulation code (packed arrays, native-like behavior).