Struct ReadOnlySlice<T>
A slice of a read-only list.
Inherited Members
Namespace: Flame.Collections
Assembly: Flame.dll
Syntax
public struct ReadOnlySlice<T>
Type Parameters
| Name | Description |
|---|---|
| T |
Constructors
| Edit this page View SourceReadOnlySlice(IReadOnlyList<T>)
Creates a read-only slice of a list that contains the entire list.
Declaration
public ReadOnlySlice(IReadOnlyList<T> list)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<T> | list | The list to "slice." |
ReadOnlySlice(IReadOnlyList<T>, int, int)
Creates a read-only slice of a list.
Declaration
public ReadOnlySlice(IReadOnlyList<T> list, int offset, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<T> | list | The list to slice. |
| int | offset | The offset in the list of the first element in the slice. |
| int | count | The number of elements in the slice. |
Properties
| Edit this page View SourceCount
Declaration
public readonly int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
this[int]
Declaration
public T this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index |
Property Value
| Type | Description |
|---|---|
| T |
Methods
| Edit this page View SourceToArray()
Creates an array whose elements are the same as this slice's.
Declaration
public T[] ToArray()
Returns
| Type | Description |
|---|---|
| T[] | An array. |