# Yarn Namespace

## Summary

Contains classes for working with compiled Yarn programs.

## Classes

| Name                                                                    | Description                                                                                                                                                              |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [BuiltinTypes](/2.0/api/csharp/yarn/yarn.builtintypes.md)               | Contains the built-in types available in the Yarn language.                                                                                                              |
| [Dialogue](/2.0/api/csharp/yarn/yarn.dialogue.md)                       | Co-ordinates the execution of Yarn programs.                                                                                                                             |
| [DialogueException](/2.0/api/csharp/yarn/yarn.dialogueexception.md)     | An exception that is thrown by [Dialogue](/2.0/api/csharp/yarn/yarn.dialogue.md) when there is an error in executing a [Program](/2.0/api/csharp/yarn/yarn.program.md) . |
| [FunctionType](/2.0/api/csharp/yarn/yarn.functiontype.md)               | A type that represents functions.                                                                                                                                        |
| [Library](/2.0/api/csharp/yarn/yarn.library.md)                         | A collection of functions that can be called from Yarn programs.                                                                                                         |
| [MemoryVariableStore](/2.0/api/csharp/yarn/yarn.memoryvariablestore.md) | A simple concrete implementation of [IVariableStorage](/2.0/api/csharp/yarn/yarn.ivariablestorage.md) that keeps all variables in memory.                                |
| [Node](/2.0/api/csharp/yarn/yarn.node.md)                               | A node of Yarn script, contained within a [Program](/2.0/api/csharp/yarn/yarn.program.md) , and containing `Yarn.Instruction` s.                                         |
| [Program](/2.0/api/csharp/yarn/yarn.program.md)                         | A compiled Yarn program.                                                                                                                                                 |

## Delegates

| Name                                                                            | Description                                                                                                                            |
| ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| [CommandHandler](/2.0/api/csharp/yarn/yarn.commandhandler.md)                   | Represents the method that is called when the Dialogue delivers a [Command](/2.0/api/csharp/yarn/yarn.command.md) .                    |
| [DialogueCompleteHandler](/2.0/api/csharp/yarn/yarn.dialoguecompletehandler.md) | Represents the method that is called when the dialogue has reached its end, and no more code remains to be run.                        |
| [LineHandler](/2.0/api/csharp/yarn/yarn.linehandler.md)                         | Represents the method that is called when the Dialogue delivers a [Line](/2.0/api/csharp/yarn/yarn.line.md) .                          |
| [Logger](/2.0/api/csharp/yarn/yarn.logger.md)                                   | Represents a method that receives diagnostic messages and error information from a [Dialogue](/2.0/api/csharp/yarn/yarn.dialogue.md) . |
| [NodeCompleteHandler](/2.0/api/csharp/yarn/yarn.nodecompletehandler.md)         | Represents the method that is called when the Dialogue reaches the end of a node.                                                      |
| [NodeStartHandler](/2.0/api/csharp/yarn/yarn.nodestarthandler.md)               | Represents the method that is called when the Dialogue begins executing a node.                                                        |
| [OptionsHandler](/2.0/api/csharp/yarn/yarn.optionshandler.md)                   | Represents the method that is called when the Dialogue delivers an [OptionSet](/2.0/api/csharp/yarn/yarn.optionset.md) .               |
| [PrepareForLinesHandler](/2.0/api/csharp/yarn/yarn.prepareforlineshandler.md)   | Represents the method that is called when the dialogue anticipates that it will deliver lines.                                         |

## Interfaces

| Name                                                              | Description                                                                          |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [IType](/2.0/api/csharp/yarn/yarn.itype.md)                       | Defines properties that describe a type in the Yarn language.                        |
| [IVariableStorage](/2.0/api/csharp/yarn/yarn.ivariablestorage.md) | Provides a mechanism for storing and retrieving instances of the `Yarn.Value` class. |

## Namespaces

| Name                                              | Description                                                              |
| ------------------------------------------------- | ------------------------------------------------------------------------ |
| [Yarn.Compiler](/2.0/api/csharp/yarn.compiler.md) | Contains classes for compiling Yarn code.                                |
| [Yarn.Markup](/2.0/api/csharp/yarn.markup.md)     | Contains classes for working with markup in Yarn lines.                  |
| [Yarn.Unity](/2.0/api/csharp/yarn.unity.md)       | Contains classes for working with Yarn Spinner in the Unity game engine. |

## Structs

| Name                                                | Description                                                                                                                                                     |
| --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Command](/2.0/api/csharp/yarn/yarn.command.md)     | A command, sent from the [Dialogue](/2.0/api/csharp/yarn/yarn.dialogue.md) to the game.                                                                         |
| [Line](/2.0/api/csharp/yarn/yarn.line.md)           | A line of dialogue, sent from the [Dialogue](/2.0/api/csharp/yarn/yarn.dialogue.md) to the game.                                                                |
| [OptionSet](/2.0/api/csharp/yarn/yarn.optionset.md) | A set of [Option](/2.0/api/csharp/yarn/yarn.optionset/yarn.optionset.option.md) s, sent from the [Dialogue](/2.0/api/csharp/yarn/yarn.dialogue.md) to the game. |


---

# 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://docs.yarnspinner.dev/2.0/api/csharp/yarn.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.
