Polyphase Game Engine
Loading...
Searching...
No Matches
DataAsset Class Reference

#include <DataAsset.h>

Inheritance diagram for DataAsset:
Asset Object

Public Member Functions

 DECLARE_ASSET (DataAsset, Asset)
 
 DataAsset ()
 
virtual ~DataAsset ()
 
virtual void Create () override
 
virtual void Destroy () override
 
virtual void LoadStream (Stream &stream, Platform platform) override
 
virtual void SaveStream (Stream &stream, Platform platform) override
 
virtual void GatherProperties (std::vector< Property > &outProps) override
 
virtual glm::vec4 GetTypeColor () override
 
virtual const char * GetTypeName () override
 
virtual bool ShouldSnapshotForPie () const override
 
void SetScriptFile (const std::string &path)
 
const std::string & GetScriptFile () const
 
DatumGetPropertyValue (const std::string &name)
 
bool SetPropertyValue (const std::string &name, const Datum &value)
 
const std::vector< Property > & GetDataProperties () const
 
std::vector< Property > & GetDataProperties ()
 
void ReloadPropertiesFromScript ()
 
- Public Member Functions inherited from Asset
 DECLARE_FACTORY_MANAGER (Asset)
 
 DECLARE_FACTORY (Asset, Asset)
 
 DECLARE_OBJECT (Asset, Object)
 
 Asset ()
 
virtual ~Asset ()
 
virtual void Copy (Asset *srcAsset)
 
const std::string & GetName () const
 
bool IsLoaded () const
 
bool IsRefCounted () const
 
int32_t GetRefCount () const
 
bool IsEmbedded () const
 
void SetEmbedded (bool embed)
 
bool IsEngineAsset () const
 
void SetEngineAsset (bool engineAsset)
 
void SetName (const std::string &name)
 
void IncrementRefCount ()
 
void DecrementRefCount ()
 
void LoadFile (const char *path, AsyncLoadRequest *request=nullptr)
 
void LoadEmbedded (const EmbeddedFile *embeddedAsset, AsyncLoadRequest *request=nullptr)
 
void SaveFile (const char *path, Platform platform)
 
virtual bool Import (const std::string &path, ImportOptions *options=nullptr)
 
virtual const char * GetTypeImportExt ()
 
bool IsTransient () const
 
void SetTransient (bool transient)
 
uint64_t GetUuid () const
 
void SetUuid (uint64_t uuid)
 
void EnsureUuid ()
 
void WriteHeader (Stream &stream)
 
- Public Member Functions inherited from Object
virtual ~Object ()=default
 
virtual const char * RuntimeName () const =0
 
virtual const char * RuntimeParentName () const =0
 
virtual RuntimeId InstanceRuntimeId () const =0
 
virtual ObjectQueryInterface (RuntimeId id) const
 
virtual bool Is (RuntimeId id) const
 
virtual bool Is (const char *name) const
 
virtual bool DrawCustomProperty (Property &prop)
 
template<typename T >
T * As () const
 
virtual bool Equals (const Object *rhs) const
 

Protected Member Functions

void LoadPropertiesFromLua ()
 
void SyncPropertyStorage ()
 

Static Protected Member Functions

static bool HandlePropChange (Datum *datum, uint32_t index, const void *newValue)
 

Protected Attributes

std::string mScriptFile
 
std::vector< PropertymProperties
 
bool mPropertiesLoaded = false
 
- Protected Attributes inherited from Asset
uint32_t mVersion = 0
 
TypeId mType = INVALID_TYPE_ID
 
uint64_t mUuid = 0
 
bool mEmbedded = false
 
bool mLoaded = false
 
bool mEnableRefCount = true
 
bool mEngineAsset = false
 
bool mTransient = false
 
std::string mName = "Asset"
 
int32_t mRefCount = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from Asset
static AssetHeader ReadHeader (Stream &stream)
 
static std::string GetNameFromPath (const std::string &path)
 
static std::string GetDirectoryFromPath (const std::string &path)
 
static const char * GetNameFromTypeId (TypeId id)
 
static TypeId GetTypeIdFromName (const char *name)
 
- Static Public Member Functions inherited from Object
static const char * ClassRuntimeName ()
 

Constructor & Destructor Documentation

◆ DataAsset()

DataAsset::DataAsset ( )

◆ ~DataAsset()

DataAsset::~DataAsset ( )
virtual

Member Function Documentation

◆ Create()

void DataAsset::Create ( )
overridevirtual

Reimplemented from Asset.

◆ DECLARE_ASSET()

DataAsset::DECLARE_ASSET ( DataAsset  ,
Asset   
)

◆ Destroy()

void DataAsset::Destroy ( )
overridevirtual

Reimplemented from Asset.

◆ GatherProperties()

void DataAsset::GatherProperties ( std::vector< Property > &  outProps)
overridevirtual

Reimplemented from Asset.

◆ GetDataProperties() [1/2]

std::vector< Property > & DataAsset::GetDataProperties ( )
inline

◆ GetDataProperties() [2/2]

const std::vector< Property > & DataAsset::GetDataProperties ( ) const
inline

◆ GetPropertyValue()

Datum * DataAsset::GetPropertyValue ( const std::string &  name)

◆ GetScriptFile()

const std::string & DataAsset::GetScriptFile ( ) const
inline

◆ GetTypeColor()

glm::vec4 DataAsset::GetTypeColor ( )
overridevirtual

Reimplemented from Asset.

◆ GetTypeName()

const char * DataAsset::GetTypeName ( )
overridevirtual

Reimplemented from Asset.

◆ HandlePropChange()

bool DataAsset::HandlePropChange ( Datum datum,
uint32_t  index,
const void *  newValue 
)
staticprotected

◆ LoadPropertiesFromLua()

void DataAsset::LoadPropertiesFromLua ( )
protected

◆ LoadStream()

void DataAsset::LoadStream ( Stream stream,
Platform  platform 
)
overridevirtual

Reimplemented from Asset.

◆ ReloadPropertiesFromScript()

void DataAsset::ReloadPropertiesFromScript ( )

◆ SaveStream()

void DataAsset::SaveStream ( Stream stream,
Platform  platform 
)
overridevirtual

Reimplemented from Asset.

◆ SetPropertyValue()

bool DataAsset::SetPropertyValue ( const std::string &  name,
const Datum value 
)

◆ SetScriptFile()

void DataAsset::SetScriptFile ( const std::string &  path)

◆ ShouldSnapshotForPie()

virtual bool DataAsset::ShouldSnapshotForPie ( ) const
inlineoverridevirtual

Reimplemented from Asset.

◆ SyncPropertyStorage()

void DataAsset::SyncPropertyStorage ( )
protected

Member Data Documentation

◆ mProperties

std::vector<Property> DataAsset::mProperties
protected

◆ mPropertiesLoaded

bool DataAsset::mPropertiesLoaded = false
protected

◆ mScriptFile

std::string DataAsset::mScriptFile
protected

The documentation for this class was generated from the following files: