---
title: EntityEquipment
framework: tabletopkit
role: symbol
role_heading: Protocol
path: tabletopkit/entityequipment
---

# EntityEquipment

A protocol for equipment in a game that you render using RealityKit.

## Declaration

```swift
protocol EntityEquipment : Equipment
```

## Overview

Overview To render equipment using an entity, follow these steps: Create a structure that conforms to this protocol. Depending on the type of equipment, set the State type alias to either BaseEquipmentState, DieState, or CardState. Declare the id property as a EquipmentIdentifier structure. Declare the initialState property as a State structure. Implement an initializer that sets these properties and the entity property. struct Piece: EntityEquipment {     typealias State = BaseEquipmentState

var id: EquipmentIdentifier     var entity: Entity     var initialState: State

@MainActor     init(index: Int = 0, position: TableVisualState.Point2D) {         id = .piece(index)         entity = try! ModelEntity.load(named: "chess/queen", in: contentBundle)         initialState = State(parentID: .table, pose: .init(position: position, rotation: .init()), entity: entity)     } } Optionally, implement the layoutChildren(for:visualState:) method for equipment that represents groups, and the restingOrientation(state:) method to provide a custom resting position. For example, implement the restingOrientation(state:) method to flip a card face down in a card game: func restingOrientation(state: State) -> Rotation3D {     state.faceUp ? .identity : .init(angle: .init(degrees: +180), axis: .init(x: 0, y: 0, z: 1)) }

## Topics

### Displaying the equipment

- [entity](tabletopkit/entityequipment/entity.md)

## Relationships

### Inherits From

- [Equipment](tabletopkit/equipment.md)
- [Identifiable](swift/identifiable.md)

## See Also

### Equipment

- [Implementing playing card overlap and physical characteristics](tabletopkit/implementing-playing-card-overlap-and-physical-characteristics.md)
- [Equipment](tabletopkit/equipment.md)
- [EquipmentCollection](tabletopkit/equipmentcollection.md)
- [EquipmentIdentifier](tabletopkit/equipmentidentifier.md)
- [EquipmentState](tabletopkit/equipmentstate.md)
- [EquipmentStateCollection](tabletopkit/equipmentstatecollection.md)
- [BaseEquipmentState](tabletopkit/baseequipmentstate.md)
- [CustomEquipmentState](tabletopkit/customequipmentstate.md)
- [MutableEquipmentState](tabletopkit/mutableequipmentstate.md)
- [CardState](tabletopkit/cardstate.md)
- [DieState](tabletopkit/diestate.md)
- [RawValueState](tabletopkit/rawvaluestate.md)
- [ControllingSeats](tabletopkit/controllingseats.md)
