Class ComponentList<T>
Namespace: ValveResourceFormat.IO.ContentFormats.HalfEdgeMesh
Assembly: ValveResourceFormat.dll
The components of one kind held by a mesh, along with the data streams attached to them.
public class ComponentList<T> : IEnumerable<T>, IEnumerableType Parameters
T
Component type, one of vertex, face, or half edge.
Inheritance
Implements
Properties
ActiveList
Indices of the slots still in use.
public IEnumerable<int> ActiveList { get; }Property Value
Count
Number of slots, counting deallocated ones.
public int Count { get; }Property Value
this[int]
Gets the component at an index.
public T this[int index] { get; }Property Value
T
Methods
Allocate(T, int)
Appends a component and grows every attached data stream with it.
public int Allocate(T component, int sourceIndex = -1)Parameters
component T
Component to append.
sourceIndex int
Slot the new stream entries copy from, -1 to leave them default.
Returns
Index of the new slot.
AllocateMultiple(int, T)
Appends several copies of a component and grows every attached data stream with them.
public void AllocateMultiple(int count, T component)Parameters
count int
How many slots to append.
component T
Component to copy into each slot.
CreateDataStream<TDataStream>(string)
Attaches a named data stream, sized to the current component count.
public TDataStream CreateDataStream<TDataStream>(string name) where TDataStream : IDataStream, new()Parameters
name string
Name to register the stream under.
Returns
TDataStream
Type Parameters
TDataStream
Stream type to create.
Exceptions
A stream with that name already exists.
Deallocate(int)
Marks a slot unused. The slot keeps its data until the mesh is compacted.
public void Deallocate(int index)Parameters
index int
Slot to release.
GetEnumerator()
Returns an enumerator over every slot, including deallocated ones.
public IEnumerator<T> GetEnumerator()Returns
IEnumerator<T>
IsAllocated(int)
Whether a slot is in use. Out of range indices return false.
public bool IsAllocated(int index)Parameters
index int
Slot to test.

