# Blackboard

{% hint style="info" %}
Variables are identified by a unique GUID in blackboards. You can still get a variable by it’s name but you have to make sure that the name is unique.
{% endhint %}

### Namespace

<pre class="language-csharp"><code class="lang-csharp"><strong>using FlowReactor.BlackboardSystem;
</strong></code></pre>

### GetVariableByName

```csharp
public T GetVariableByName<T> (string name) where T : FRVariable
```

Return a blackboard variable of type T by its name. \
Make sure that variable names are unique.

**Example - Get variable by its name**

```csharp
using FlowReactor;
using FlowReactor.BlackboardSystem;
 
// reference to blackboard
public BlackBoard variables;
 
// get variable value of type int with the name health
var _healthVariable = variables.GetVariableByName<FRInt>("health");
 
Debug.Log(_healthVariable.Value);
```

**Example - Modify variable value**

```csharp
using FlowReactor;
using FlowReactor.BlackboardSystem;
 
// reference to blackboard
public BlackBoard variables;
 
// First we get the variable reference from the blackboard of type FRInt
var _healthVariable = variables.GetVariableByName<FRInt>("health");
 
// Then we can simply modify the variable
_healthVariable.Value --;
 
Debug.Log(_healthVariable.Value);
```

### SaveToFile

```csharp
public void SaveToFile(string _fileName, SavePath _savePath, SaveFormat _format)
```

Saves the serialized blackboard to a file.

| Parameters          | Description                                       |
| ------------------- | ------------------------------------------------- |
| string \_fileName   | The file name which should be used for saving     |
| SavePath \_savePath | The save path, declared by the SavePath enum.     |
| SaveFormat \_format | The save format, declared by the SaveFormat enum. |

### LoadFromFile

```csharp
public void LoadFromFile(string _fileName, SavePath _savePath, SaveFormat _format)
```

Loads a serialized blackboard from a file.
