# DataLibrary

## Save

Save the runtime-DataLibrary to a json file

* \_path: The path including file name with extension

## Load

Load json file to runtime-DataLibrary

* \_path: The path including file name with extension

## GetRuntimeDataObjectByGuid

Returns a runtime-DataObject by its guid

* \_guid: The guid as string
* \_type: optional type

## GetInitialDataObjectByGuid

Returns an initial-DataObject by its guid

* \_guid: The guid as string
* \_type: optional type

## GetRuntimeDataObjectByTitle

Returns a runtime-DataObject by its name

* \_title: name of the DataObject
* \_type: optional type

## GetInitialDataObjectByTitle

Returns an initial-DataObject by its name

* \_title: name of the DataObject
* \_type: optional type

## GetInitialFirstDataObjectByType

Get the first dataobject in the list by type. This is useful for manager types where we only have one object

* \_type: DataObject type

## GetAllRuntimeDataObjectsByType

Returns a list of all runtime data objects of type

* \_type: DataObject type
* \_includeSubtypes: optional, include subtypes to the list

## GetAllInitialDataObjectsByType

Returns a list of all initial data objects of type

* \_type: DataObject type
* \_includeSubtypes: optional, include subtypes to the list

## RuntimeDataObjectWithGuidExists

Returns true or false whether DataObject exists or not

* \_guid: the guid of the DataObject
* \_type: optional type

## InitialDataObjectWithGuidExists

Returns true or false whether a DataObject exists or not

* \_guid: the guid of the DataObject
* \_type: optional type

## CloneDataObjectToRuntime

This will make a new instance of the data object and add it to the runtime DataLibrary object. If the DataObject has a runtime data class, it can then be serialized.

* \_data: The initial DataObject to clone
* \_ownerGameObject: When providing an owner game object, the runtime clone will use the object instance id instead of a guid. This also helps finding the appropriate runtime clone if an initial data object has multiple clones.

## RemoveDataObjectFromRuntime

Remove a DataObject from the runtime DataLibrary

* \_data: The DataObject to be removed
* \_type: optional type


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://giantgrey.gitbook.io/databrain/api/datalibrary.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
