> For the complete documentation index, see [llms.txt](https://infinitypbr.gitbook.io/magic-pig-games/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infinitypbr.gitbook.io/magic-pig-games/game-modules-4/module-documentation/game-module-lists/count-methods/gameitemobjectlist-count-methods.md).

# GameItemObjectList Count() Methods

#### Count duplicates

These methods will count any duplicates. The single-object methods have an optional `itemObjectUid`, when `null`, will get any duplicate in the entire list.

There is also an optional `bool` `includeItemAttributes`, which is `false` by default. When `true`, a `GameItemObject` must match both its `Uid()` and its list of `ItemAttributes` to qualify as a duplicate.

If `inlcudeFirstItem` is true, then all duplicates will be included, otherwise, one from each duplciate will be excluded, essentially only counting the "extras".

```csharp
public int CountDuplicates(ItemObject itemObject, bool includeItemAttributes = false, bool includeFirstItem = false)
public int CountDuplicates(GameItemObject gameItemObject, bool includeItemAttributes = false, bool includeFirstItem = false)
public int CountDuplicates(string itemObjectUid = null, bool includeItemAttributes = false, bool includeFirstItem = false)

// Only check a specific set of ItemObjects
public int CountDuplicates(IEnumerable<ItemObject> itemObjects, bool includeItemAttributes = false, bool includeFirstItem = false)
public int CountDuplicates(IEnumerable<GameItemObject> gameItemObjects, bool includeItemAttributes = false, bool includeFirstItem = false)
public int CountDuplicates(IEnumerable<string> itemObjectUids, bool includeItemAttributes = false, bool includeFirstItem = false)
```

#### Additional Count Methods

```csharp
// Counts the number of ItemObjects which are QuestItems
public int CountQuestItems(string uid = null)
```
