Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SiliconStudio.Assets.AssetItem Class Reference

An asset item part of a Package accessible through SiliconStudio.Assets.Package.Assets. More...

Inheritance diagram for SiliconStudio.Assets.AssetItem:
SiliconStudio.Assets.IFileSynchronizable SiliconStudio.Assets.IDirtyable

Public Member Functions

 AssetItem (UFile location, Asset asset)
 Initializes a new instance of the AssetItem class. More...
 
AssetReference ToReference ()
 Converts this item to a reference. More...
 
AssetItem Clone (UFile newLocation=null, Asset newAsset=null)
 Clones this instance without the attached package. More...
 
override string ToString ()
 
Asset CreateChildAsset ()
 Creates a child asset that is inheriting the values of this asset. More...
 
AssetItem FindBase ()
 Finds the base item referenced by this item from the current session (using the Package setup on this instance) More...
 
List< AssetItemFindAssetsFromChange (MemberPath path, MemberPathAction action, object value)
 This methods returns all assets that would be changed when trying to change this asset. More...
 

Static Public Attributes

static readonly
IEqualityComparer< AssetItem
DefaultComparerById = new AssetItemComparerById()
 The default comparer use only the id of an assetitem to match assets. More...
 

Properties

UFile Location [get, set]
 Gets the location of this asset. More...
 
UDirectory SourceFolder [get, set]
 Gets the directory where the assets will be stored on the disk relative to the Package. The directory will update the list found in PackageProfile.AssetFolders More...
 
Guid Id [get]
 Gets the unique identifier of this asset. More...
 
Package Package [get, set]
 Gets the package where this asset is stored. More...
 
UFile FullPath [get]
 Gets the full absolute path of this asset on the disk, taking into account the SourceFolder, and the SiliconStudio.Assets.Package.RootDirectory. See remarks. More...
 
Asset Asset [get, set]
 Gets or sets the asset. More...
 
DateTime ModifiedTime [get, set]
 Gets the modified time. See remarks. More...
 
bool IsDirty [get, set]
 Gets or sets a value indicating whether this instance is dirty. See remarks. More...
 
- Properties inherited from SiliconStudio.Assets.IFileSynchronizable
UFile FullPath [get]
 Gets the full path on disk where this instance is stored. More...
 
- Properties inherited from SiliconStudio.Assets.IDirtyable
bool IsDirty [get, set]
 Gets or sets a value indicating whether this instance is dirty. More...
 

Detailed Description

An asset item part of a Package accessible through SiliconStudio.Assets.Package.Assets.

Definition at line 17 of file AssetItem.cs.

Constructor & Destructor Documentation

SiliconStudio.Assets.AssetItem.AssetItem ( UFile  location,
Asset  asset 
)

Initializes a new instance of the AssetItem class.

Parameters
locationThe location.
assetThe asset.
Exceptions
System.ArgumentNullExceptionlocation
System.ArgumentExceptionasset

Definition at line 37 of file AssetItem.cs.

Member Function Documentation

AssetItem SiliconStudio.Assets.AssetItem.Clone ( UFile  newLocation = null,
Asset  newAsset = null 
)

Clones this instance without the attached package.

Parameters
newLocationThe new location that will be used in the cloned AssetItem. If this parameter is null, it keeps the original location of the asset.
newAssetThe new asset that will be used in the cloned AssetItem. If this parameter is null, it clones the original asset. otherwise, the specified asset is used as-is in the new AssetItem (no clone on newAsset is performed)
Returns
A clone of this instance.

Definition at line 126 of file AssetItem.cs.

Asset SiliconStudio.Assets.AssetItem.CreateChildAsset ( )

Creates a child asset that is inheriting the values of this asset.

Returns
A new asset inheriting the values of this asset.

Definition at line 256 of file AssetItem.cs.

References SiliconStudio.Assets.AssetCloner.Clone().

List<AssetItem> SiliconStudio.Assets.AssetItem.FindAssetsFromChange ( MemberPath  path,
MemberPathAction  action,
object  value 
)

This methods returns all assets that would be changed when trying to change this asset.

Parameters
pathThe path.
actionThe action.
valueThe value.
Returns
LoggerResult.
Exceptions
System.ArgumentNullExceptionpath

Definition at line 298 of file AssetItem.cs.

AssetItem SiliconStudio.Assets.AssetItem.FindBase ( )

Finds the base item referenced by this item from the current session (using the Package setup on this instance)

Returns
The base item or null if not found.

Definition at line 280 of file AssetItem.cs.

References SiliconStudio.Assets.Asset.Base, SiliconStudio.Assets.AssetBase.IsRootImport, and SiliconStudio.Assets.Package.Session.

AssetReference SiliconStudio.Assets.AssetItem.ToReference ( )

Converts this item to a reference.

Returns
AssetReference.

Definition at line 112 of file AssetItem.cs.

override string SiliconStudio.Assets.AssetItem.ToString ( )

Definition at line 247 of file AssetItem.cs.

Member Data Documentation

readonly IEqualityComparer<AssetItem> SiliconStudio.Assets.AssetItem.DefaultComparerById = new AssetItemComparerById()
static

The default comparer use only the id of an assetitem to match assets.

Definition at line 28 of file AssetItem.cs.

Property Documentation

UFile SiliconStudio.Assets.AssetItem.FullPath
get

Gets the full absolute path of this asset on the disk, taking into account the SourceFolder, and the SiliconStudio.Assets.Package.RootDirectory. See remarks.

The full absolute path of this asset on the disk.

This value is only valid if this instance is attached to a Package, and that the package has a non null SiliconStudio.Assets.Package.RootDirectory.

Definition at line 168 of file AssetItem.cs.

Referenced by SiliconStudio.Assets.Compiler.ThumbnailCompilerBase< T >.CompileOverride().

Guid SiliconStudio.Assets.AssetItem.Id
get

Gets the unique identifier of this asset.

The unique identifier.

Definition at line 85 of file AssetItem.cs.

Referenced by SiliconStudio.Assets.PackageAssetCollection.CheckCanAdd(), and SiliconStudio.Assets.AssetImportSession.Import().

bool SiliconStudio.Assets.AssetItem.IsDirty
getset

Gets or sets a value indicating whether this instance is dirty. See remarks.

true if this instance is dirty; otherwise, false.

When an asset is modified, this property must be set to true in order to track assets changes.

Definition at line 227 of file AssetItem.cs.

UFile SiliconStudio.Assets.AssetItem.Location
getset

Gets the location of this asset.

The location.

Definition at line 51 of file AssetItem.cs.

Referenced by SiliconStudio.Assets.AssetImportSession.AddExistingAssetForReImport(), and SiliconStudio.Assets.Compiler.AssetCompilerBase< T >.Compile().

DateTime SiliconStudio.Assets.AssetItem.ModifiedTime
getset

Gets the modified time. See remarks.

The modified time.

By default, contains the last modified time of the asset from the disk. If IsDirty is also updated from false to true , this time will get current time of modification.

Definition at line 217 of file AssetItem.cs.

UDirectory SiliconStudio.Assets.AssetItem.SourceFolder
getset

Gets the directory where the assets will be stored on the disk relative to the Package. The directory will update the list found in PackageProfile.AssetFolders

The directory.

Definition at line 69 of file AssetItem.cs.


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