Summary
A
System.Collections.Generic.List`1 which can remove items without needing to search the entire collection.- Assembly
- Animancer
.dll - Namespace
- Animancer
- Interfaces
-
- IList
<T> - ICollection
- IList
- Base Types
-
- Object
graph BT
Type-->Base0["Object"]
Type-.->Interface0["IList<T>"]
Type-.->Interface1["ICollection"]
Type["Key.KeyedList<T>"]
class Type type-node
Syntax
public class Key.KeyedList<T> : IList<T>, ICollection where T : class, Key.IListItem
Remarks
This implementation has several restrictions compared to a regular
System.Collections.Generic.List`1:
- Items must implement
or inherit from . - Items cannot be
null . - Items can only be in one
at a time and cannot appear multiple times in it.
Animancer.Key so it can modify the private Animancer.Key._Index without
exposing that capability to anything else.
Type Parameters
| Name | Description |
|---|---|
| T |
Constructors
| Name | Summary |
|---|---|
| KeyedList |
Creates a new Animancer.Key.KeyedList`1 using the default System.Collections.Generic.List`1 constructor. |
| KeyedList |
Creates a new Animancer.Key.KeyedList`1 with the specified initial `capacity`. |
Properties
Methods
| Name | Value | Summary |
|---|---|---|
| Add |
void |
Adds the `item` to the end of this list.
|
| AddNew |
void |
Adds the `item` to the end of this list if it wasn't already in it.
|
| Clear |
void |
Removes all items from this list.
|
| Contains |
bool |
Indicates whether the `item` is currently in this list.
|
| CopyTo |
void |
Copies all the items from this list into the `array`, starting at the specified `index`.
|
| GetEnumerator |
List |
Returns an enumerator that iterates through this list.
|
| IndexOf |
int |
Returns the index of the `item` in this list or
-1 if it is not in this list. |
| Insert |
void |
Adds the `item` to this list at the specified `index`.
|
| Remove |
bool |
Removes the `item` from this list.
|
| RemoveAt |
void |
Removes the item at the specified `index`.
|
| RemoveAtSwap |
void |
Removes the item at the specified `index` by swapping the last item in this list into its place.
|
| RemoveSwap |
bool |
Removes the `item` by swapping the last item in this list into its place.
|