# Add data objects

To add new custom data to Databrain, simply follow these steps.

1. Create a new class (for example EnemyData) with some fields and derive from DataObject.

<pre class="language-csharp"><code class="lang-csharp"><strong>using Databrain;
</strong>
public class EnemyData : DataObject
{
    public int health;
    public float strength;
}
</code></pre>

2. Save the file and wait for compilation.
3. Create a new DataLibrary object in your project. Right click in the project view and select: **Create / Databrain / Data Library**
4. Open the DataLibrary. You can now find your newly created EnemyData type in the global namespace category.

<div align="left"><figure><img src="https://2348672745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIoqF5QAgQsqxrjmTIKpE%2Fuploads%2FECYcXsGQLikFNWny6dqI%2FenemyDataCategory.png?alt=media&#x26;token=a65a9f0d-1540-4093-8897-3bd53073980e" alt=""><figcaption></figcaption></figure></div>

5. Select the EnemyData type and click on create.

<div align="left"><figure><img src="https://2348672745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIoqF5QAgQsqxrjmTIKpE%2Fuploads%2FFizYXr3n9nrOpAxhJfST%2FcreateNewObject.png?alt=media&#x26;token=94a15197-9760-4a4f-aa0c-5cfd78b03c95" alt=""><figcaption></figcaption></figure></div>

## Categorization and more

You can categorize data types by namespace, data types and derived types. For example, following code:

```csharp
using Databrain;

namespace Enemies
{
    public class EnemyData : DataObject
    {
        public int health;
        public float strength;
    }
}
```

Sub type:

```csharp
using Databrain;

namespace Enemies
{
    // Derived from EnemyData
    public class Orc : EnemyData
    {
        // Orc specific fields
    }
}
```

Results in this:

<div align="left"><figure><img src="https://2348672745-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIoqF5QAgQsqxrjmTIKpE%2Fuploads%2FkENJkiREWlK9Lq3IuCly%2FcategoryAndSubtype.PNG?alt=media&#x26;token=bd3791ed-1928-4d77-85e2-a4c9d151acd3" alt=""><figcaption></figcaption></figure></div>

You can also define a color and icon for your data types. Please read the attributes section for more information:

{% content-ref url="../attributes/dataobject-attributes" %}
[dataobject-attributes](../attributes/dataobject-attributes)
{% endcontent-ref %}
