---
description: (protocol)
---

# Item

參考：[圖例](../../../appendix/misc/legend)、[型別繼承圖](..#xing-bie-ji-cheng-tu)

## Declaration

```swift
public protocol Item: class, Animatable, Identifiable, CustomDebugStringConvertible
```

:arrow\_upper\_left: inherits from：[🅿️ Animatable](animatable), [🅿️ Identifiable](identifiable), :parking:[CustomDebugStringConvertible](https://developer.apple.com/documentation/swift/customdebugstringconvertible)

:arrow\_lower\_right: comformed by：[🍄 Actor](actor), [🍄 Portal](portal)

### Instance Property Requirements

| 屬性                       | 型別          | 說明 |
| ------------------------ | ----------- | -- |
| **id**                   | Identifier  |    |
| **world**                | GridWorld?  |    |
| **node**                 | NodeWrapper |    |
| **verticalOffset**       | SCNFloat    |    |
| **isStackable**          | Bool        |    |
| **speakableDescription** | String      |    |

### Instance Method Requirements

| 方法                                         | 參數              | 型別                | 說明 |
| ------------------------------------------ | --------------- | ----------------- | -- |
| **loadGeometry**()                         |                 |                   |    |
| **updateAppearance**(**traitCollection**:) | traitCollection | UITraitCollection |    |

### Static Property Requirements

| 屬性             | 型別                  | 說明 |
| -------------- | ------------------- | -- |
| **identifier** | WorldNodeIdentifier |    |

## Protocol Extension

### Instance Properties

| 屬性                           | 型別                 | 預設行為╱說明                                                                                                               |
| ---------------------------- | ------------------ | --------------------------------------------------------------------------------------------------------------------- |
| **heading** :1234:           | Direction          |                                                                                                                       |
| **coordinate** :1234:        | Coordinate         |                                                                                                                       |
| **height** :1234:            | Int                |                                                                                                                       |
| **isStackable** :1234:       | Bool               | false                                                                                                                 |
| **verticalOffset** :1234:    | SCNFloat           | 0                                                                                                                     |
| **baseMessage** :1234:       | \[PlaygroundValue] |                                                                                                                       |
| **debugDescription** :1234:  | String             | :parking:[CustomDebugStringConvertible](https://developer.apple.com/documentation/swift/customdebugstringconvertible) |

### Instance Methods

| 方法                                  | 參數       | 型別           | 傳回        | 預設行為╱說明                      |
| ----------------------------------- | -------- | ------------ | --------- | ---------------------------- |
| **removeFromWorld**()               |          |              |           | `world?.remove(self)`        |
| **reset**()                         |          |              |           | [🅿️ Animatable](animatable) |
| **placeAction**(**withDuration**:)  | duration | TimeInterval | SCNAction | [🅿️ Animatable](animatable) |
| **removeAction**(**withDuration**:) | duration | TimeInterval | SCNAction | [🅿️ Animatable](animatable) |
