# Library

Class in [Yarn](/api/csharp/yarn.md)

Inherits from `System.Object`

## Summary

A collection of functions that can be called from Yarn programs.

```csharp
public class Library
```

## Remarks

You do not create instances of this class yourself. The [Dialogue](/api/csharp/yarn/yarn.dialogue.md) class creates one of its own, which you can access via the [Library](/api/csharp/yarn/yarn.dialogue/yarn.dialogue.library.md) property.

## Methods

| Name                                                                                                                                                          | Description                                                                                                                                                                                               |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [DeregisterFunction(string)](/api/csharp/yarn/yarn.library/yarn.library.deregisterfunction.md)                                                                | Removes a function from the Library.                                                                                                                                                                      |
| [FunctionExists(string)](/api/csharp/yarn/yarn.library/yarn.library.functionexists.md)                                                                        | Gets a value indicating whether this [Library](/api/csharp/yarn/yarn.library.md) contains a function named `name` .                                                                                       |
| [GenerateUniqueVisitedVariableForNode(string)](/api/csharp/yarn/yarn.library/yarn.library.generateuniquevisitedvariablefornode.md)                            | Generates a unique tracking variable name. This is intended to be used to generate names for visting. Ideally these will very reproduceable and sensible. For now it will be something terrible and easy. |
| [GetFunction(string)](/api/csharp/yarn/yarn.library/yarn.library.getfunction.md)                                                                              | Returns a `System.Delegate` with a given name.                                                                                                                                                            |
| [ImportLibrary(Library)](/api/csharp/yarn/yarn.library/yarn.library.importlibrary.md)                                                                         | Loads functions from another [Library](/api/csharp/yarn/yarn.library.md) .                                                                                                                                |
| [RegisterFunction(string,Delegate)](/api/csharp/yarn/yarn.library/yarn.library.registerfunction-7.md)                                                         | Registers a new function that returns a value, which can be called from a Yarn program.                                                                                                                   |
| [RegisterFunction(string,Func)](/api/csharp/yarn/yarn.library/yarn.library.registerfunction-1.md)                                                             | Registers a new function that returns a value, which can be called from a Yarn program.                                                                                                                   |
| [RegisterFunction\<T1, TResult>(string,Func\<T1, TResult>)](/api/csharp/yarn/yarn.library/yarn.library.registerfunction-2.md)                                 | Registers a new function that returns a value, which can be called from a Yarn program.                                                                                                                   |
| [RegisterFunction\<T1, T2, TResult>(string,Func\<T1, T2, TResult>)](/api/csharp/yarn/yarn.library/yarn.library.registerfunction-3.md)                         | Registers a new function that returns a value, which can be called from a Yarn program.                                                                                                                   |
| [RegisterFunction\<T1, T2, T3, TResult>(string,Func\<T1, T2, T3, TResult>)](/api/csharp/yarn/yarn.library/yarn.library.registerfunction-4.md)                 | Registers a new function that returns a value, which can be called from a Yarn program.                                                                                                                   |
| [RegisterFunction\<T1, T2, T3, T4, TResult>(string,Func\<T1, T2, T3, T4, TResult>)](/api/csharp/yarn/yarn.library/yarn.library.registerfunction-5.md)         | Registers a new function that returns a value, which can be called from a Yarn program.                                                                                                                   |
| [RegisterFunction\<T1, T2, T3, T4, T5, TResult>(string,Func\<T1, T2, T3, T4, T5, TResult>)](/api/csharp/yarn/yarn.library/yarn.library.registerfunction-6.md) | Registers a new function that returns a value, which can be called from a Yarn program.                                                                                                                   |

## See Also

* [Dialogue](/api/csharp/yarn/yarn.dialogue.md): Co-ordinates the execution of Yarn programs.


---

# 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/api/csharp/yarn/yarn.library.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.
