Class AssetMetaFileWithSourceAndDirectory<TSource, TProfile, TExporter>
An asset with a source element.
Inheritance
Inherited Members
Namespace: Evergine.Assets.Exporters
Assembly: Evergine.Assets.dll
Syntax
public abstract class AssetMetaFileWithSourceAndDirectory<TSource, TProfile, TExporter> : AssetMetafile<TProfile, TExporter>, IAssetWithSource, IAssetWithDirectory, IAssetMetaFile where TSource : AssetSource where TProfile : AssetProfile where TExporter : IAssetExporter
Type Parameters
Name | Description |
---|---|
TSource | The resource asset. |
TProfile | The profile class. |
TExporter | The exporter class. |
Constructors
AssetMetaFileWithSourceAndDirectory(TSource, ContentDirectory, TProfile)
Initializes a new instance of the AssetMetaFileWithSourceAndDirectory<TSource, TProfile, TExporter> class.
Declaration
public AssetMetaFileWithSourceAndDirectory(TSource resource, ContentDirectory assetDirectory, TProfile defaultProfile)
Parameters
Type | Name | Description |
---|---|---|
TSource | resource | the resource. |
ContentDirectory | assetDirectory | The asset directory. |
TProfile | defaultProfile | the default profile. |
Properties
Assets
Gets the contained assets.
Declaration
public List<AssetItem> Assets { get; }
Property Value
Type | Description |
---|---|
List<AssetItem> |
NeedsToImportData
Gets a value indicating whether the source data needs to be imported when exporting.
Declaration
public virtual bool NeedsToImportData { get; }
Property Value
Type | Description |
---|---|
bool |
Source
Gets or sets the asset resource.
Declaration
public TSource Source { get; set; }
Property Value
Type | Description |
---|---|
TSource |
SourceDirectory
Gets or sets the resource file.
Declaration
public ContentDirectory SourceDirectory { get; set; }
Property Value
Type | Description |
---|---|
ContentDirectory |
SourceDirectoryName
Gets the name of the directory that this asset should manage.
Declaration
public virtual string SourceDirectoryName { get; }
Property Value
Type | Description |
---|---|
string |
SourceFile
Gets or sets the resource file.
Declaration
public ContentFile SourceFile { get; set; }
Property Value
Type | Description |
---|---|
ContentFile |
Methods
AddAssetItem(AssetItem)
Adds the asset item to the directory.
Declaration
public void AddAssetItem(AssetItem assetItem)
Parameters
Type | Name | Description |
---|---|---|
AssetItem | assetItem | The asset item. |
ChecksDirectoryIntegrity(ContentDirectory)
Checks the integrity of this asset. A common behavior is to check if the source directory is available.
Declaration
public virtual bool ChecksDirectoryIntegrity(ContentDirectory parentDirectory)
Parameters
Type | Name | Description |
---|---|---|
ContentDirectory | parentDirectory | The parent directory of this asset. |
Returns
Type | Description |
---|---|
bool | True if this assets pass the integrity check. |
EnumerateAllAssets()
Enumerates all assets in this directory and its children directory.
Declaration
public virtual IEnumerable<AssetItem> EnumerateAllAssets()
Returns
Type | Description |
---|---|
IEnumerable<AssetItem> | All assets in this directory and its children directory. |
FindAssetItem(string)
Gets an asset contained in the directory by its name.
Declaration
public AssetItem FindAssetItem(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The asset name. |
Returns
Type | Description |
---|---|
AssetItem | The asset item. |
FindAssetItem(string, Type, bool)
Gets an asset contained in the directory by its name.
Declaration
public AssetItem FindAssetItem(string name, Type type, bool recursive)
Parameters
Type | Name | Description |
---|---|---|
string | name | The asset name. |
Type | type | The type of the asset. |
bool | recursive | if the search is recursive. |
Returns
Type | Description |
---|---|
AssetItem | The asset item. |
FindAssetItem<T>(string, bool)
Gets an asset contained in the directory by its name.
Declaration
public AssetItem FindAssetItem<T>(string name, bool recursive = false) where T : IAssetMetaFile
Parameters
Type | Name | Description |
---|---|---|
string | name | The asset name. |
bool | recursive | if the search is recursive. |
Returns
Type | Description |
---|---|
AssetItem | The asset item. |
Type Parameters
Name | Description |
---|---|
T | The type of the asset. |
FindAssetItems(Type)
Gets an asset contained in the directory by its name.
Declaration
public List<AssetItem> FindAssetItems(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type of the asset. |
Returns
Type | Description |
---|---|
List<AssetItem> | The asset item. |
FindAssetItems<T>()
Gets an asset contained in the directory by its name.
Declaration
public List<AssetItem> FindAssetItems<T>() where T : IAssetMetaFile
Returns
Type | Description |
---|---|
List<AssetItem> | The asset item. |
Type Parameters
Name | Description |
---|---|
T | The type of the asset. |