# CardList

Undocumented

- `cards()`
  
  The list of cards currently added to the card system, in the order they can be displayed to the user.

#### Declaration

#### Return Value

An array of cards currently added to the card list.

- `setCards(_:)`
  
  Sets the cards to be maintained by the card list.

#### Declaration

#### Parameters

|     |     |
| --- | --- |
| `<br>                                cards<br>` | The array of cards. |

- `add(_:)`
  
  Appends a card to the end of the current list of cards in the card system.

#### Declaration

#### Parameters

|     |     |
| --- | --- |
| `<br>                                card<br>` | The card to be added. |

- `insert(_:at:)`
  
  Inserts a card into the current list of cards in the card system at a specific index.

#### Declaration

#### Parameters

|     |     |
| --- | --- |
| `<br>                                card<br>` | The card to be added. |
| `<br>                                index<br>` | The location in the current list of cards to insert the card. |

- `card(forKey:)`
  
  Returns the card in the current card system that matches the given key.
  @discussion Keys are meant to be unique. If multiple cards match the given key,
  the first in the list that matches will be returned.

#### Declaration

#### Parameters

|     |     |
| --- | --- |
| `<br>                                key<br>` | The key of the card to be returned. |

#### Return Value

The card in the current card system that matches the given key.

- `replaceCard(forKey:with:)`
  
  Replaces the card in the current card system that matches the given key with a new card.
  @discussion Keys are meant to be unique. If multiple cards match the given key, the
  first in the list that matches will be replaced. If no cards match, no replacement will occur.

#### Declaration

#### Parameters

|     |     |
| --- | --- |
| `<br>                                key<br>` | The key of the card to be replaced. |

- `removeCard(forKey:)`
  
  Removes the card in the current card system that matches the given key.
  @discussion Keys are meant to be unique. If multiple cards match the given key, the
  first in the list that matches will be removed.

#### Declaration

#### Parameters

|     |     |
| --- | --- |
| `<br>                                key<br>` | The key of the card to be removed. |

- `removeAllCards()`
  
  Removes all cards in the current card system.

#### Declaration
