# Enquiry

Step 1 :&#x20;

Create an empty scene with any name of your liking and open the scene.

Step 2 : Adding necessary scene game objects for this exercise.

Go to the Prefabs folder inside path UIs/Essential and drag ChessGameObjectBase prefab into the scene hierachy.

<figure><img src="/files/JsaNYN1mEDbOm7hcXZz4" alt=""><figcaption></figcaption></figure>

Then, create a canvas and drag the dropdown prefab located inside Base folder of path Prefabs/UIs/Dropdown into the canvas. Or create a legacy dropdown of your own on the scene, the dropdown prefab is actually  the same as legacy dropdown.&#x20;

<figure><img src="/files/FUJLPZL7C5partccN3G3" alt=""><figcaption></figcaption></figure>

Step 3 :&#x20;

Copy code below to ChessEnquiryManager.cs located in Scripts/Main/Communicators folder

```
    public delegate int TotalDropdownOptionCount();
    public static event TotalDropdownOptionCount EnquiryTotalDropdownOptionCount;
    
    public static int GetTotalDropdownOptionCount()
    {
        var hasValue = EnquiryTotalDropdownOptionCount?.Invoke();

        if (hasValue != null)
        {
            return (int)hasValue;
        }
        else
        {
            throw new System.NullReferenceException(GenerateErrorMessage(typeof(TotalDropdownOptionCount).Name));
        }
    }
```

Step 4 :&#x20;

Create a C# script in the path Scripts/Main/UIs/Dropdowns named DummyDropdown.cs and copy the code below into it. The `GetOptionsCount()` function is from the base class, getting the number of dropdown options currently the dropdown have.

<pre><code><strong>namespace TheChess
</strong><strong>{
</strong><strong>    public class DummyDropdown : ChessDropdownUI
</strong>    {
        protected override void Subscribes()
        {
            ChessEnquiryManager.EnquiryTotalDropdownOptionCount += GetOptionsCount;
        }
    
        protected override void Unsubscribes()
        {
            ChessEnquiryManager.EnquiryTotalDropdownOptionCount -= GetOptionsCount;
        }
    }
}
</code></pre>

Step 5 :&#x20;

The code below can be called in any GUI script to get the number of dropdown options.

```
        Debug.Log(ChessEnquiryManager.GetTotalDropdownOptionCount());
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://freedom-developer.gitbook.io/the-chess/the-uis/enquiry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
