class

FDataAssetStore

Loads, caches and saves data assets. Every loaded asset is rooted: the store keeps it alive until Unload, so a handle read from a reference stays valid.

Module
Game
Header
#include "Game/MDataAsset.h"
Namespace
Mowo

Type aliases

AliasDescription
using FMigrateFn = void (*)(uint32_t storedVersion, MDF::MdfNode& objectNode)A class's own data version, the data-asset counterpart of an actor class's: the writer stamps _version on the Object node above 1, a loader runs migrate on an older node before any property is read and leaves a newer file's extra keys in place.

Public functions

ReturnsNameDescription
MDataAsset*LoadThe asset at path (a VFS path such as "Assets/Weapons/Rifle.data"), loading it on first request.
MDataAsset*LoadAsLoad, then require the asset to be expected or a subclass of it.
MDataAsset*CreateAn asset made in memory, not yet saved.
boolSaveWrites the asset to nativePath and records it as the asset's path.
std::stringSerialize
MDataAsset*LoadFromString
boolIsObjectAssetWhether the text is an object data asset (names a data_class).
voidRegisterClassVersion
voidUnload
voidUnloadAll
std::vector<MClass*>FindClassesEvery registered concrete MDataAsset subclass, by name: what a "New Data Asset" menu offers.
std::vector<MDataAsset*>FindLoadedLoaded assets of a class or its subclasses, by primary id order.

Function details

Load

C++
static MDataAsset* Load(const std::string& path)

The asset at path (a VFS path such as "Assets/Weapons/Rifle.data"), loading it on first request. Null when the file is missing, is not an object data asset (a struct-based one reads through DataAsset) or names a class that is not registered.

LoadAs

C++
static MDataAsset* LoadAs(const std::string& path, const MClass* expected)

Load, then require the asset to be expected or a subclass of it.

Create

C++
static MDataAsset* Create(MClass* dataClass)

An asset made in memory, not yet saved.

Save

C++
static bool Save(MDataAsset* asset, const std::string& nativePath)

Writes the asset to nativePath and records it as the asset's path.

Serialize

C++
static std::string Serialize(MDataAsset* asset)

LoadFromString

C++
static MDataAsset* LoadFromString(const std::string& text, const std::string& path)

IsObjectAsset

C++
static bool IsObjectAsset(const std::string& text)

Whether the text is an object data asset (names a data_class).

RegisterClassVersion

C++
static void RegisterClassVersion(const std::string& className, uint32_t version, FMigrateFn migrate)

Unload

C++
static void Unload(const std::string& path)

UnloadAll

C++
static void UnloadAll()

FindClasses

C++
static std::vector<MClass*> FindClasses()

Every registered concrete MDataAsset subclass, by name: what a "New Data Asset" menu offers.

FindLoaded

C++
static std::vector<MDataAsset*> FindLoaded(const MClass* base)

Loaded assets of a class or its subclasses, by primary id order.

Generated from Game/MDataAsset.h via game.json · Dec 5, 2026Version 1.1.0