> For the complete documentation index, see [llms.txt](https://docs.yarnspinner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.md).

# Yarn Namespace

## Summary

Contains classes for working with compiled Yarn programs.

## Classes

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

## Delegates

| Name                                                                                                        | Description                                                                                                                                                        |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [CommandHandler](https://docs.yarnspinner.dev/2.0/api/csharp/yarn/yarn.commandhandler.md)                   | Represents the method that is called when the Dialogue delivers a [Command](https://docs.yarnspinner.dev/2.0/api/csharp/yarn/yarn.command.md) .                    |
| [DialogueCompleteHandler](https://docs.yarnspinner.dev/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](https://docs.yarnspinner.dev/2.0/api/csharp/yarn/yarn.linehandler.md)                         | Represents the method that is called when the Dialogue delivers a [Line](https://docs.yarnspinner.dev/2.0/api/csharp/yarn/yarn.line.md) .                          |
| [Logger](https://docs.yarnspinner.dev/2.0/api/csharp/yarn/yarn.logger.md)                                   | Represents a method that receives diagnostic messages and error information from a [Dialogue](https://docs.yarnspinner.dev/2.0/api/csharp/yarn/yarn.dialogue.md) . |
| [NodeCompleteHandler](https://docs.yarnspinner.dev/2.0/api/csharp/yarn/yarn.nodecompletehandler.md)         | Represents the method that is called when the Dialogue reaches the end of a node.                                                                                  |
| [NodeStartHandler](https://docs.yarnspinner.dev/2.0/api/csharp/yarn/yarn.nodestarthandler.md)               | Represents the method that is called when the Dialogue begins executing a node.                                                                                    |
| [OptionsHandler](https://docs.yarnspinner.dev/2.0/api/csharp/yarn/yarn.optionshandler.md)                   | Represents the method that is called when the Dialogue delivers an [OptionSet](https://docs.yarnspinner.dev/2.0/api/csharp/yarn/yarn.optionset.md) .               |
| [PrepareForLinesHandler](https://docs.yarnspinner.dev/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](https://docs.yarnspinner.dev/2.0/api/csharp/yarn/yarn.itype.md)                       | Defines properties that describe a type in the Yarn language.                        |
| [IVariableStorage](https://docs.yarnspinner.dev/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](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.compiler.md) | Contains classes for compiling Yarn code.                                |
| [Yarn.Markup](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.markup.md)     | Contains classes for working with markup in Yarn lines.                  |
| [Yarn.Unity](https://docs.yarnspinner.dev/2.0/api/csharp/yarn.unity.md)       | Contains classes for working with Yarn Spinner in the Unity game engine. |

## Structs

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