> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XSystemDeviceType

> XSystemDeviceType

# XSystemDeviceType

指出呼叫 [XSystemGetDeviceType](/zh-TW/reference/system/xsystem/functions/xsystemgetdevicetype) 所傳回的系統裝置類型。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
enum class XSystemDeviceType  : uint32_t
{
    Unknown              = 0x00,
    Pc                   = 0x01,
    XboxOne              = 0x02,
    XboxOneS             = 0x03,
    XboxOneX             = 0x04,
    XboxOneXDevkit       = 0x05,
    XboxScarlettLockhart = 0x06,
    XboxScarlettAnaconda = 0x07,
    XboxScarlettDevkit   = 0x08
}
```

<a id="constantsSection" />

## 常數

| 常數 | 描述 |
| - | - |
| Unknown | 裝置類型不明。當無法判斷裝置類型時，`XSystemGetDeviceType` 會傳回此值。 |
| Pc | 裝置為 PC。 |
| XboxOne | 裝置為 XBOX One。 |
| XboxOneS | 裝置為 XBOX One S。 |
| XboxOneX | 裝置為 XBOX One X。 |
| XboxOneXDevkit | 裝置為 XBOX One X 開發套件。 |
| XboxScarlettLockhart | 裝置為 XBOX Series S。 |
| XboxScarlettAnaconda | 裝置為 XBOX Series X。 |
| XboxScarlettDevkit | 裝置為 XBOX Series X 開發套件。 |

<a id="remarksSection" />

## 備註

`XSystemGetDeviceType` 函式沒有明確的錯誤狀態。如果無法判斷系統裝置類型，它會傳回 `XSystemDeviceType::Unknown` 值。

您可以在早期遊戲初始化期間，於呼叫 [XGameRuntimeInitialize](/zh-TW/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize) 之前呼叫 `XSystemGetDeviceType`。

下列程式碼範例會取得目前使用中的系統裝置類型。如果是在開發套件上執行，則會執行自訂程式碼以在遊戲內啟用開發人員功能。

```cpp theme={null}
const XSystemDeviceType deviceType = XSystemGetDeviceType();

const bool deviceIsDevkit = 
    deviceType == XSystemDeviceType::XboxOneXDevkit || 
    deviceType == XSystemDeviceType::XboxScarlettDevkit;

if (deviceIsDevkit)
{
    EnableGameSpecificDevkitFeatures();
}
```

<a id="requirementsSection" />

## 需求

**標頭：** XSystem.h

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

<a id="seealsoSection" />

## 另請參閱

[XSystem](/zh-TW/reference/system/xsystem/xsystem_members)\
[XSystemGetDeviceType](/zh-TW/reference/system/xsystem/functions/xsystemgetdevicetype)\
[XGameRuntimeInitialize](/zh-TW/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize)


## Related topics

- [XSystemDeviceType](/reference/system/xsystem/enums/xsystemdevicetype.md)
- [XSystemGetDeviceType](/reference/system/xsystem/functions/xsystemgetdevicetype.md)
- [XSystem](/reference/system/xsystem/xsystem_members.md)
- [Intelligent Delivery: device specifiers](/build/core-features/common/packaging/intelligentdelivery-device.md)
- [Intelligent Delivery: especificadores de dispositivo](/es/build/core-features/common/packaging/intelligentdelivery-device.md)
