Struct ValueList<T>
A growable list that is implemented as a value type. This type is mainly intended for use by other collection types, and is not a drop-in replacement for System.Collections.Generic.List.
Inherited Members
Namespace: Flame.Collections
Assembly: Flame.dll
Syntax
public struct ValueList<T>
Type Parameters
Name | Description |
---|---|
T |
Constructors
| Improve this Doc View SourceValueList(ValueList<T>)
Creates a list by copying another list's contents.
Declaration
public ValueList(ValueList<T> other)
Parameters
Type | Name | Description |
---|---|---|
ValueList<T> | other | The list whose contents are to be copied. |
ValueList(IEnumerable<T>)
Creates a list from a sequence of values.
Declaration
public ValueList(IEnumerable<T> values)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | values | The values to put in the list. |
ValueList(Int32)
Creates a list with an initial capacity.
Declaration
public ValueList(int initialCapacity)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | initialCapacity | The list's initial capacity. |
Properties
| Improve this Doc View SourceCapacity
Gets the size of this list's backing array.
Declaration
public int Capacity { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Count
Gets the number of items in this list.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
IsInitialized
Tells if this value list has been properly initialized by a constructor.
Declaration
public bool IsInitialized { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Item[Int32]
Gets the element at the given index in this list.
Declaration
public T this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type | Description |
---|---|
T |
Items
Gets the backing array for this list.
Declaration
public T[] Items { get; }
Property Value
Type | Description |
---|---|
T[] |
Methods
| Improve this Doc View SourceAdd(T)
Appends the given value to this list.
Declaration
public void Add(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value |
AddRange(ValueList<T>)
Appends the given value list to this list.
Declaration
public void AddRange(ValueList<T> values)
Parameters
Type | Name | Description |
---|---|---|
ValueList<T> | values |
RemoveAt(Int32)
Removes the element at the given index. All values to the right of the given index are shifted one position to the left.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Reserve(Int32)
Minimizes at least the given capacity in this list.
Declaration
public void Reserve(int minimalCapacity)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | minimalCapacity |
ToArray()
Copies the contents of this value list to an array.
Declaration
public T[] ToArray()
Returns
Type | Description |
---|---|
T[] | An array. |