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

# CardState

A state for cards that contains face up and down information.

```
struct CardState
```

## Topics

### Creating a card state

[`init(faceUp: Bool, parentID: EquipmentIdentifier, seatControl: ControllingSeats, pose: TableVisualState.Pose2D, boundingBox: Rect3D)`](/documentation/TabletopKit/CardState/init(faceUp:parentID:seatControl:pose:boundingBox:))

Creates the state of a card using its visibility, location, and player interactions.

[`init(faceUp: Bool, parentID: EquipmentIdentifier, seatControl: ControllingSeats, pose: TableVisualState.Pose2D, entity: Entity)`](/documentation/TabletopKit/CardState/init(faceUp:parentID:seatControl:pose:entity:))

Creates a card state with the given faceUp value, parent, controlling seats, pose, and associated entity providing the bounding box.

[`static func faceDown(parentID: EquipmentIdentifier, seatControl: ControllingSeats, pose: TableVisualState.Pose2D, boundingBox: Rect3D) -> CardState`](/documentation/TabletopKit/CardState/faceDown(parentID:seatControl:pose:boundingBox:))

[`static func faceDown(parentID: EquipmentIdentifier, seatControl: ControllingSeats, pose: TableVisualState.Pose2D, entity: Entity) -> CardState`](/documentation/TabletopKit/CardState/faceDown(parentID:seatControl:pose:entity:))

[`static func faceUp(parentID: EquipmentIdentifier, seatControl: ControllingSeats, pose: TableVisualState.Pose2D, boundingBox: Rect3D) -> CardState`](/documentation/TabletopKit/CardState/faceUp(parentID:seatControl:pose:boundingBox:))

[`static func faceUp(parentID: EquipmentIdentifier, seatControl: ControllingSeats, pose: TableVisualState.Pose2D, entity: Entity) -> CardState`](/documentation/TabletopKit/CardState/faceUp(parentID:seatControl:pose:entity:))

### Getting the card data

[`var faceUp: Bool`](/documentation/TabletopKit/CardState/faceUp)

A Boolean value that indicates whether the card is oriented face up, revealing its contents.

### Getting the parent equipment

[`var parentID: EquipmentIdentifier`](/documentation/TabletopKit/CardState/parentID)

The identifier for the parent equipment that holds or contains this equipment.

### Rendering the equipment

[`var boundingBox: Rect3D`](/documentation/TabletopKit/CardState/boundingBox)

A 3D bounding box that encloses the card.

[`var pose: TableVisualState.Pose2D`](/documentation/TabletopKit/CardState/pose)

The 2D position and rotation of the equipment relative to the equipment parent, or table.

### Controlling the equipment

[`var lockedBy: PlayerIdentifier?`](/documentation/TabletopKit/CardState/lockedBy)

The identifier for the player who exclusively controls the equipment.

[`var seatControl: ControllingSeats`](/documentation/TabletopKit/CardState/seatControl)

The seats that can manipulate or interact with the equipment.

## Relationships

### Conforms To

[`Escapable`](/documentation/Swift/Escapable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Copyable`](/documentation/Swift/Copyable)

[`MutableEquipmentState`](/documentation/TabletopKit/MutableEquipmentState)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`EquipmentState`](/documentation/TabletopKit/EquipmentState)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

---

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)