# MemoryVariableStore

Class in [Yarn](https://docs.yarnspinner.dev/api/csharp/yarn)

Inherits from `System.Object`

## Summary

A simple concrete implementation of [IVariableStorage](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.ivariablestorage) that keeps all variables in memory.

```csharp
public class MemoryVariableStore : IVariableStorage
```

## Methods

| Name                                                                                                                                      | Description                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Clear()](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.clear)                           | Removes all variables from storage.                                                                                                                                                                                                                                                                                                                                                |
| [GetVariableKind(string)](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.getvariablekind) | Gets the kind of variable named `name` .                                                                                                                                                                                                                                                                                                                                           |
| [SetValue(string,bool)](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.setvalue-3)        | Stores a `bool` in this VariableStorage.                                                                                                                                                                                                                                                                                                                                           |
| [SetValue(string,float)](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.setvalue-2)       | Stores a `float` in this VariableStorage.                                                                                                                                                                                                                                                                                                                                          |
| [SetValue(string,string)](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.setvalue-1)      | Stores a `string` in this VariableStorage.                                                                                                                                                                                                                                                                                                                                         |
| [TryGetValue(string,T?)](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.trygetvalue)      | Given a variable name, attempts to fetch a value for the variable, either from storage, initial values found in [Program](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.program) , or by evaluating a smart variable found in [Program](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.program) . |

## Properties

| Name                                                                                                                                            | Description                                                                                                                                                                                                                                       |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Program](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.program)                               | Gets or sets the Yarn [Program](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.ivariableaccess/yarn.ivariableaccess.program) that stores information about the initial values of variables, and is able to produce values for smart variables. |
| [SmartVariableEvaluator](https://docs.yarnspinner.dev/api/csharp/yarn/yarn.memoryvariablestore/yarn.memoryvariablestore.smartvariableevaluator) | Gets or sets the object to use when evaluating smart variables.                                                                                                                                                                                   |
