# FastListCore<T>

Array-backed list with a separate element count. AsSpan covers the live range and AsArray exposes the backing array.

Namespace: MeatMotion.Collections

Assembly: MeatMotion

```csharp
public struct FastListCore<T>
```

[Runtime/Collections/MotionCollections.cs · L7](../../../source/Runtime/Collections/MotionCollections.cs.html#L7)

## Empty

Default list with no entries.

```csharp
public static readonly FastListCore<T> Empty;
```

[Runtime/Collections/MotionCollections.cs · L13](../../../source/Runtime/Collections/MotionCollections.cs.html#L13)

## Length

Number of live entries in the backing array.

```csharp
public readonly int Length { get; }
```

[Runtime/Collections/MotionCollections.cs · L16](../../../source/Runtime/Collections/MotionCollections.cs.html#L16)

## this

Read or replace an indexed slot. Use an index below Length.

```csharp
public readonly T this[int index] { get; set; }
```

[Runtime/Collections/MotionCollections.cs · L17](../../../source/Runtime/Collections/MotionCollections.cs.html#L17)

## AsSpan

Return a span covering only live entries.

```csharp
public readonly Span<T> AsSpan()
```

Return value

- Returns: `Span<T>`

[Runtime/Collections/MotionCollections.cs · L18](../../../source/Runtime/Collections/MotionCollections.cs.html#L18)

## AsArray

Return the backing array including unused capacity.

```csharp
public readonly T[] AsArray()
```

Return value

- Returns: `T[]`

[Runtime/Collections/MotionCollections.cs · L19](../../../source/Runtime/Collections/MotionCollections.cs.html#L19)

## EnsureCapacity

Reserve backing space for at least the requested number of elements.

```csharp
public void EnsureCapacity(int capacity)
```

Parameters

- `capacity` (`int`) Number of entries to reserve.

[Runtime/Collections/MotionCollections.cs · L21](../../../source/Runtime/Collections/MotionCollections.cs.html#L21)

## Add

Append an element, growing the backing array when needed.

```csharp
public void Add(T element)
```

Parameters

- `element` (`T`) Element to append.

[Runtime/Collections/MotionCollections.cs · L29](../../../source/Runtime/Collections/MotionCollections.cs.html#L29)

## RemoveAtSwapback

Remove an entry by moving the last element into its slot, which changes ordering.

```csharp
public void RemoveAtSwapback(int index)
```

Parameters

- `index` (`int`) Index of the entry to operate on.

[Runtime/Collections/MotionCollections.cs · L35](../../../source/Runtime/Collections/MotionCollections.cs.html#L35)

## Clear

Clear the entries and reset the count. Set removeArray to also release the backing array.

```csharp
public void Clear(bool removeArray = false)
```

Parameters

- `removeArray = false` (`bool`) Also release the backing array when true.

[Runtime/Collections/MotionCollections.cs · L42](../../../source/Runtime/Collections/MotionCollections.cs.html#L42)
