> For the complete documentation index, see [llms.txt](https://maraudical.gitbook.io/status-effects-framework/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://maraudical.gitbook.io/status-effects-framework/type-specifics/scriptable-objects/statuseffectdatabase.md).

# StatusEffectDatabase

### Description

For most use cases the StatusEffectDatabase can be ignored as it automatically handles adding and removing [StatusEffectDatas](/status-effects-framework/type-specifics/scriptable-objects/statuseffectdata.md). However, if dynamically adding and removing from the database is desired (for example with addressables) it can easily be done. To begin changing the database simply call the static method **StatusEffectDatabase.Get()**. The asset will always be located in the `Assets/Resources/` folder.

{% hint style="warning" %}
For Netcode, additional work will need to be done to sync across client and server. A sample for how this could be done would closely resemble [Unity's sample for dynamic prefab loading](https://github.com/Unity-Technologies/com.unity.multiplayer.samples.bitesize/tree/main/Basic/DynamicAddressablesNetworkPrefabs).
{% endhint %}

### Properties

<table data-full-width="true"><thead><tr><th width="250">Name</th><th width="250">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>Count</code></td><td>int</td><td>An integer value of the total <a href="/pages/FzvWc4ygR9G3YZgoRwuJ">StatusEffectDatas</a> in the database.</td></tr><tr><td><code>ReadOnlyDictionary</code></td><td><a href="https://learn.microsoft.com/en-us/dotnet/api/system.collections.objectmodel.readonlydictionary-2">ReadOnlyDictionary</a>&#x3C;<a href="https://docs.unity3d.com/ScriptReference/Hash128.html">Hash128</a>, <a href="/pages/FzvWc4ygR9G3YZgoRwuJ">StatusEffectData</a>></td><td>A read only reference to the values in the database.</td></tr></tbody></table>

### Methods

<table data-full-width="true"><thead><tr><th width="250">Name</th><th>Description</th></tr></thead><tbody><tr><td><a href="/pages/4I9nf3YvorRMBsdEnhQw">Get</a></td><td>Returns a reference to the <a href="/pages/kmuoiDYKnYqP0alZMqIG">StatusEffectDatabase</a>.</td></tr><tr><td><a href="/pages/fXfm2P93h6fUqCCXhu4s">Add</a></td><td>Adds a <a href="/pages/FzvWc4ygR9G3YZgoRwuJ">StatusEffectData</a> to the database.</td></tr><tr><td><a href="/pages/adZQF0Ud9uM76P4AjudI">TryAdd</a></td><td>Adds a <a href="/pages/FzvWc4ygR9G3YZgoRwuJ">StatusEffectData</a> to the database.</td></tr><tr><td><a href="/pages/BeQaEqU3cMmgSIcDUrFm">GetValueOrDefault</a></td><td>Extension of CollectionExtensions <a href="https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.collectionextensions.getvalueordefault">GetValueOrDefault</a>.</td></tr><tr><td><a href="/pages/wsEgtji0bsfVODm9NX9M">TryGetValue</a></td><td>Extension of Dictionary <a href="https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2.trygetvalue">TryGetValue</a>.</td></tr><tr><td><a href="/pages/Nd7Gxqiv9fVDG7YFaLFW">ContainsKey</a></td><td>Extension of Dictionary <a href="https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2.containskey">ContainsKey</a>.</td></tr><tr><td><a href="/pages/5kVuP0j1iiGVXfSVBI9T">IsUnique</a></td><td>Inverse of <a href="/pages/Nd7Gxqiv9fVDG7YFaLFW">ContainsKey</a>.</td></tr></tbody></table>
