> For the complete documentation index, see [llms.txt](https://vargr-integrations.gitbook.io/vargr-integrations/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vargr-integrations.gitbook.io/vargr-integrations/registered-scriptable-objects/rsodatabase.md).

# RSODatabase

This is a simple Scriptable Object that stores all the relevant data that could be required.  It functions as a mass database to allow quick recall of Scriptable Objects (SO) using a Key (INT) as the reference if known but also allow a search to find the correct Key when it is not known.&#x20;

```csharp
public ScriptableObject Get(int key)
```

This is a simple get based on knowing the Key of the object you are looking for, it will always return it as a scriptable object, so the code calling this data should know what type of (SO)[^1] and cast it correctly.

```csharp
public int GetKey(ScriptableObject target)
```

This searches the database looking for the correct one related to the supplied (SO) and returns the Key (INT), if the (SO) is a [RSORoot](/vargr-integrations/registered-scriptable-objects/rsoroot.md), it will grab the id stored in that (SO)

```csharp
public virtual void Add(ScriptableObject data, bool generateKey = true)
```

General Call that adds a (SO) to the database, this generateKey will force a new key to be generated.

If the (SO) that is being added is an [RSORoot](/vargr-integrations/registered-scriptable-objects/rsoroot.md), this will also set the Key in the (SO) to speed up search times.

[^1]: Scriptable Object
