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

A package managing assets. More...

Inheritance diagram for SiliconStudio.Assets.Package:
SiliconStudio.Assets.Asset SiliconStudio.Assets.IFileSynchronizable SiliconStudio.Assets.IDirtyable

Public Member Functions

 Package ()
 Initializes a new instance of the Package class. More...
 
LoggerResult AddExitingProject (UFile pathToMsproj)
 Adds an exiting project to this package. More...
 
void AddExitingProject (UFile pathToMsproj, LoggerResult logger)
 Adds an exiting project to this package. More...
 
Package Clone (bool deepCloneAsset)
 Deep clone this package. More...
 
void SetPackagePath (UFile newPath, bool copyAssets=true)
 Sets the package path. More...
 
LoggerResult Save ()
 Saves this package and all dirty assets. See remarks. More...
 
void Save (ILogger log)
 Saves this package and all dirty assets. See remarks. More...
 
void ValidateAssets (bool alwaysGenerateNewAssetId=false)
 
void LoadTemporaryAssets (ILogger log, CancellationToken?cancelToken=null)
 Refreshes this package from the disk by loading or reloading all assets. More...
 
- Public Member Functions inherited from SiliconStudio.Assets.Asset
virtual void SetDefaults ()
 Sets the defaults values for this instance More...
 
override string ToString ()
 

Static Public Member Functions

static Guid GetPackageIdFromFile (string filePath)
 Gets the package identifier from file. More...
 
static Package Load (ILogger log, string filePath, PackageLoadParameters loadParametersArg=null)
 Loads only the package description but not assets or plugins. More...
 

Public Attributes

const string PackageFileExtension = ".pdxpkg"
 The file extension used for Package. More...
 

Properties

bool IsSystem [get, set]
 Gets or sets a value indicating whether this package is a system package. More...
 
PackageMeta Meta [get, set]
 Gets or sets the metadata associated with this package. More...
 
List< PackageReferenceLocalDependencies [get]
 Gets the local package dependencies used by this package (only valid for local references). Global dependencies are defined through the Meta property in PackageMeta.Dependencies More...
 
PackageProfileCollection Profiles [get, set]
 Gets the profiles. More...
 
List< UDirectoryExplicitFolders [get]
 Gets or sets the list of folders that are explicitly created but contains no assets. More...
 
BundleCollection Bundles [get, set]
 Gets the bundles defined for this package. More...
 
List< TemplateFolderTemplateFolders [get, set]
 Gets the template folders. More...
 
List< TemplateDescriptionTemplates [get, set]
 Gets the loaded templates from the TemplateFolders More...
 
PackageAssetCollection Assets [get]
 Gets the assets stored in this package. More...
 
AssetItemCollection TemporaryAssets [get]
 Gets the temporary assets list loaded from disk before they are going into Assets. More...
 
UFile FullPath [get, set]
 Gets the path to the package file. May be null if the package was not loaded or saved. More...
 
bool IsDirty [get, set]
 Gets or sets a value indicating whether this instance has been modified since last saving. More...
 
UDirectory RootDirectory [get]
 Gets the top directory of this package on the local disk. More...
 
PackageSession Session [get, set]
 Gets the session. More...
 
- Properties inherited from SiliconStudio.Assets.Asset
Guid Id [get, set]
 Gets or sets the unique identifier of this asset. More...
 
int SerializedVersion [get, set]
 Gets or sets the version number for this asset, used internally when migrating assets. More...
 
AssetBase Base [get, set]
 Gets or sets the base. More...
 
int BuildOrder [get, set]
 Gets or sets the build order for this asset. More...
 
TagCollection Tags [get, set]
 Gets the tags for this asset. 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...
 

Events

Action< AssetAssetDirtyChanged
 Occurs when an asset dirty changed occured. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SiliconStudio.Assets.Asset
 Asset ()
 Initializes a new instance of the Asset class. More...
 

Detailed Description

A package managing assets.

Definition at line 28 of file Package.cs.

Constructor & Destructor Documentation

SiliconStudio.Assets.Package.Package ( )

Initializes a new instance of the Package class.

Definition at line 56 of file Package.cs.

Member Function Documentation

LoggerResult SiliconStudio.Assets.Package.AddExitingProject ( UFile  pathToMsproj)

Adds an exiting project to this package.

Parameters
pathToMsprojThe path to msproj.
Returns
LoggerResult.

Definition at line 240 of file Package.cs.

void SiliconStudio.Assets.Package.AddExitingProject ( UFile  pathToMsproj,
LoggerResult  logger 
)

Adds an exiting project to this package.

Parameters
pathToMsprojThe path to msproj.
loggerThe logger.

Definition at line 252 of file Package.cs.

References SiliconStudio.Core.IO.UPath.IsAbsolute.

Package SiliconStudio.Assets.Package.Clone ( bool  deepCloneAsset)

Deep clone this package.

Parameters
deepCloneAssetif set to true assets will stored in this package will be also deeply cloned.
Returns
The package cloned.

Definition at line 313 of file Package.cs.

References SiliconStudio.Assets.AssetCloner.Clone().

static Guid SiliconStudio.Assets.Package.GetPackageIdFromFile ( string  filePath)
static

Gets the package identifier from file.

Parameters
filePathThe file path.
Returns
Guid.
Exceptions
System.ArgumentNullExceptionlog or filePath

Definition at line 499 of file Package.cs.

static Package SiliconStudio.Assets.Package.Load ( ILogger  log,
string  filePath,
PackageLoadParameters  loadParametersArg = null 
)
static

Loads only the package description but not assets or plugins.

Parameters
logThe log to receive error messages.
filePathThe file path.
loadParametersArgThe load parameters argument.
Returns
A package.
Exceptions
System.ArgumentNullExceptionlog or filePath

Definition at line 515 of file Package.cs.

void SiliconStudio.Assets.Package.LoadTemporaryAssets ( ILogger  log,
CancellationToken?  cancelToken = null 
)

Refreshes this package from the disk by loading or reloading all assets.

Parameters
logThe log.
cancelTokenThe cancel token.
Returns
A logger that contains error messages while refreshing.
Exceptions
System.InvalidOperationExceptionPackage RootDirectory is null or Package RootDirectory [{0}] does not exist.ToFormat(RootDirectory)

Definition at line 621 of file Package.cs.

References SiliconStudio.Assets.AssetCloner.Clone(), SiliconStudio.Assets.FileUtility.EnumerateDirectories(), SiliconStudio.Assets.AssetRegistry.IsAssetFileExtension(), SiliconStudio.Assets.Package.RootDirectory, and SiliconStudio.Core.IO.UDirectory.This.

LoggerResult SiliconStudio.Assets.Package.Save ( )

Saves this package and all dirty assets. See remarks.

Parameters
saveAllAssetsif set to true [save all assets].
Returns
LoggerResult.

When calling this method directly, it does not handle moving assets between packages. Call PackageSession.Save instead.

Definition at line 384 of file Package.cs.

void SiliconStudio.Assets.Package.Save ( ILogger  log)

Saves this package and all dirty assets. See remarks.

Parameters
logThe log.
Exceptions
System.ArgumentNullExceptionlog

When calling this method directly, it does not handle moving assets between packages. Call PackageSession.Save instead.

Definition at line 398 of file Package.cs.

References SiliconStudio.Assets.AssetCloner.Clone().

void SiliconStudio.Assets.Package.SetPackagePath ( UFile  newPath,
bool  copyAssets = true 
)

Sets the package path.

Parameters
newPathThe new path.
copyAssetsif set to true assets will be copied relatively to the new location.

Definition at line 333 of file Package.cs.

void SiliconStudio.Assets.Package.ValidateAssets ( bool  alwaysGenerateNewAssetId = false)

Definition at line 573 of file Package.cs.

Member Data Documentation

const string SiliconStudio.Assets.Package.PackageFileExtension = ".pdxpkg"

Property Documentation

BundleCollection SiliconStudio.Assets.Package.Bundles
getset

Gets the bundles defined for this package.

The bundles.

Definition at line 122 of file Package.cs.

List<UDirectory> SiliconStudio.Assets.Package.ExplicitFolders
get

Gets or sets the list of folders that are explicitly created but contains no assets.

Definition at line 110 of file Package.cs.

UFile SiliconStudio.Assets.Package.FullPath
getset

Gets the path to the package file. May be null if the package was not loaded or saved.

The package path.

Definition at line 170 of file Package.cs.

Referenced by SiliconStudio.Assets.PackageReference.operator PackageReference().

bool SiliconStudio.Assets.Package.IsDirty
getset

Gets or sets a value indicating whether this instance has been modified since last saving.

true if this instance is dirty; otherwise, false.

Definition at line 187 of file Package.cs.

bool SiliconStudio.Assets.Package.IsSystem
getset

Gets or sets a value indicating whether this package is a system package.

true if this package is a system package; otherwise, false.

Definition at line 75 of file Package.cs.

Referenced by SiliconStudio.Assets.PackageSession.Save().

List<PackageReference> SiliconStudio.Assets.Package.LocalDependencies
get

Gets the local package dependencies used by this package (only valid for local references). Global dependencies are defined through the Meta property in PackageMeta.Dependencies

The package local dependencies.

Definition at line 91 of file Package.cs.

Referenced by SiliconStudio.Assets.PackageExtensions.ContainsAsset(), and SiliconStudio.Assets.PackageSession.Save().

PackageMeta SiliconStudio.Assets.Package.Meta
getset

Gets or sets the metadata associated with this package.

The meta.

Definition at line 82 of file Package.cs.

Referenced by SiliconStudio.Assets.PackageExtensions.ContainsAsset(), and SiliconStudio.Assets.PackageSession.Save().

PackageProfileCollection SiliconStudio.Assets.Package.Profiles
getset

Gets the profiles.

The profiles.

Definition at line 103 of file Package.cs.

UDirectory SiliconStudio.Assets.Package.RootDirectory
get

Gets the top directory of this package on the local disk.

The top directory.

Definition at line 205 of file Package.cs.

Referenced by SiliconStudio.Assets.Package.LoadTemporaryAssets().

List<TemplateFolder> SiliconStudio.Assets.Package.TemplateFolders
getset

Gets the template folders.

The template folders.

Definition at line 129 of file Package.cs.

List<TemplateDescription> SiliconStudio.Assets.Package.Templates
getset

Gets the loaded templates from the TemplateFolders

The templates.

Definition at line 136 of file Package.cs.

AssetItemCollection SiliconStudio.Assets.Package.TemporaryAssets
get

Gets the temporary assets list loaded from disk before they are going into Assets.

The temporary assets.

Definition at line 157 of file Package.cs.

Referenced by SiliconStudio.Assets.PackageSession.Save().

Event Documentation

Action<Asset> SiliconStudio.Assets.Package.AssetDirtyChanged

Occurs when an asset dirty changed occured.

Definition at line 51 of file Package.cs.


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