> ## 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](/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](/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](/reference/system/xsystem/xsystem_members)\
[XSystemGetDeviceType](/reference/system/xsystem/functions/xsystemgetdevicetype)\
[XGameRuntimeInitialize](/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize)


## Related topics

- [XSystem](/zh-CN/reference/system/xsystem/xsystem_members.md)
- [Intelligent Delivery：设备修饰符](/zh-CN/build/core-features/common/packaging/intelligentdelivery-device.md)
- [了解 PlayFab Party 聊天的工作原理](/zh-CN/services/playfab/community/voice-communications/concepts-chat.md)
- [PartyAudioDeviceSelectionType](/zh-CN/services/playfab/multiplayer/networking/reference/enums/partyaudiodeviceselectiontype.md)
- [PartyLocalChatControl::SetAudioOutput](/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyLocalChatControl/methods/partylocalchatcontrol_setaudiooutput.md)
