# Yarn Namespace

## Summary

Contains classes for working with compiled Yarn programs.

## Classes

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

## Delegates

| Name                                                                                                     | Description                                                                                                                                                     |
| -------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [CommandHandler](https://docs.yarnspinner.dev/2.1/api/csharp/yarn/yarn.commandhandler)                   | Represents the method that is called when the Dialogue delivers a [Command](https://docs.yarnspinner.dev/2.1/api/csharp/yarn/yarn.command) .                    |
| [DialogueCompleteHandler](https://docs.yarnspinner.dev/2.1/api/csharp/yarn/yarn.dialoguecompletehandler) | 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.1/api/csharp/yarn/yarn.linehandler)                         | Represents the method that is called when the Dialogue delivers a [Line](https://docs.yarnspinner.dev/2.1/api/csharp/yarn/yarn.line) .                          |
| [Logger](https://docs.yarnspinner.dev/2.1/api/csharp/yarn/yarn.logger)                                   | Represents a method that receives diagnostic messages and error information from a [Dialogue](https://docs.yarnspinner.dev/2.1/api/csharp/yarn/yarn.dialogue) . |
| [NodeCompleteHandler](https://docs.yarnspinner.dev/2.1/api/csharp/yarn/yarn.nodecompletehandler)         | Represents the method that is called when the Dialogue reaches the end of a node.                                                                               |
| [NodeStartHandler](https://docs.yarnspinner.dev/2.1/api/csharp/yarn/yarn.nodestarthandler)               | Represents the method that is called when the Dialogue begins executing a node.                                                                                 |
| [OptionsHandler](https://docs.yarnspinner.dev/2.1/api/csharp/yarn/yarn.optionshandler)                   | Represents the method that is called when the Dialogue delivers an [OptionSet](https://docs.yarnspinner.dev/2.1/api/csharp/yarn/yarn.optionset) .               |
| [PrepareForLinesHandler](https://docs.yarnspinner.dev/2.1/api/csharp/yarn/yarn.prepareforlineshandler)   | Represents the method that is called when the dialogue anticipates that it will deliver lines.                                                                  |

## Interfaces

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

## Namespaces

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

## Structs

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