<!--
{
  "availability" : [
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "TabletopKit",
  "identifier" : "/documentation/TabletopKit/EquipmentCollection",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "TabletopKit"
    ],
    "preciseIdentifier" : "s:11TabletopKit19EquipmentCollectionV"
  },
  "title" : "EquipmentCollection"
}
-->

# EquipmentCollection

A collection of equipment whose state can be inspected and modified.

```
struct EquipmentCollection
```

## Topics

### Getting collection properties

[`var count: Int`](/documentation/TabletopKit/EquipmentCollection/count)

The number of equipment items in this collection.

[`var ids: [EquipmentIdentifier]`](/documentation/TabletopKit/EquipmentCollection/ids)

The identifiers of all the equipment in this collection.

[`var state: EquipmentStateCollection`](/documentation/TabletopKit/EquipmentCollection/state)

The collection of equipment states.

### Retrieving equipment identifiers

[`func ids(childrenOf: EquipmentIdentifier) -> [EquipmentIdentifier]`](/documentation/TabletopKit/EquipmentCollection/ids(childrenOf:))

Returns the identifiers of all equipment that are children of the given equipment identifier.

[`func ids(descendantsOf: EquipmentIdentifier) -> [EquipmentIdentifier]`](/documentation/TabletopKit/EquipmentCollection/ids(descendantsOf:))

Returns the identifiers of all equipment that are descendants of the given equipment identifier.

[`func ids(of: (some Equipment).Type) -> [EquipmentIdentifier]`](/documentation/TabletopKit/EquipmentCollection/ids(of:))

Returns the identifiers of all equipment that conform to the given type.

### Changing the parent

[`func reparent(id: EquipmentIdentifier, to: EquipmentIdentifier)`](/documentation/TabletopKit/EquipmentCollection/reparent(id:to:))

Change the parent of the equipment matching the given identifier. The given equipment becomes the last of the parent’s children.

[`func reparent(ids: [EquipmentIdentifier], to: EquipmentIdentifier)`](/documentation/TabletopKit/EquipmentCollection/reparent(ids:to:))

Change the parent of the equipment matching the given identifiers. The reparented equipment is appended at the end of the parent’s children.

### Accessing the subscript

[`subscript<E>(of _: E.Type) -> [(identifier: EquipmentIdentifier, state: E.State)]`](/documentation/TabletopKit/EquipmentCollection/subscript(of:))

Returns the identifiers and corresponding states of all equipment that conform to the given type.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)