> ## 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.

# XGameRuntimeIsFeatureAvailable

> XGameRuntimeIsFeatureAvailable

# XGameRuntimeIsFeatureAvailable

指出 Gaming Runtime 功能是否可用。

## 語法

```cpp theme={null}
bool XGameRuntimeIsFeatureAvailable(  
         XGameRuntimeFeature feature  
)  
```

### 參數

*feature*   \
類型：[XGameRuntimeFeature](/zh-TW/reference/system/xgameruntimefeature/enums/xgameruntimefeature)

要查詢的 Gaming Runtime 功能。

### 傳回值

類型：bool

如果 Gaming Runtime 功能可用，則傳回 **true**；否則傳回 **false**。

## 備註

使用 [XGameRuntimeInitialize](/zh-TW/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize) 初始化 Gaming Runtime 之後，使用此函式來檢查特定 Gaming Runtime 功能是否可供您的遊戲使用。

下列範例使用 **XGameRuntimeIsFeatureAvailable** 函式來檢查 Async、AsyncProvider 和 TaskQueue 功能是否可用。使用工作佇列執行非同步工作時，這三項功能都是必要的。

```cpp theme={null}
// Confirm that all of the features needed to run asynchronous tasks on 
// task queues are available.
bool Game::CheckAsyncTaskQueueFeatures()
{
    
    return (XGameRuntimeIsFeatureAvailable(XGameRuntimeFeature::XTaskQueue) &&
        XGameRuntimeIsFeatureAvailable(XGameRuntimeFeature::XAsyncProvider) &&
        XGameRuntimeIsFeatureAvailable(XGameRuntimeFeature::XAsync));

}
```

## 需求

**標頭：** XGameRuntimeFeature.h

**程式庫：** xgameruntime.lib

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

## 概念文件

* [Game Chat 2 簡介](/zh-TW/services/xbox-services/multiplayer/chat/game-chat2/game-chat-2-intro)

## 另請參閱

[Gaming Runtime 詞彙表](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/intro/gaming-runtime-glossary)\
[XGameRuntimeFeature 類別](/zh-TW/reference/system/xgameruntimefeature/xgameruntimefeature_members)\
[XGameRuntimeFeature 列舉](/zh-TW/reference/system/xgameruntimefeature/enums/xgameruntimefeature)


## Related topics

- [XGameRuntimeIsFeatureAvailable](/reference/system/xgameruntimefeature/functions/xgameruntimeisfeatureavailable.md)
- [XGameRuntimeFeature](/reference/system/xgameruntimefeature/enums/xgameruntimefeature.md)
