C#Code
C#Code
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
Libraries.AssetManager Class Reference

List of all members.

Public Member Functions

 AssetManager (IServiceProvider serviceProvider)
 AssetManager (IServiceProvider serviceProvider, string rootDirectory)
override T Load< T > (string assetName)
LoadUniqueCopy< T > (string assetName)
void UnloadAsset (string name)
StringType GetID ()
void SetID (string ID)
 AssetManager (IServiceProvider serviceProvider)
 AssetManager (IServiceProvider serviceProvider, string rootDirectory)
override T Load< T > (string assetName)
LoadUniqueCopy< T > (string assetName)
void UnloadAsset (string name)
void UnloadTrackedAssets ()
new void Dispose ()
StringType GetID ()
void SetID (string ID)
 AssetManager (IServiceProvider serviceProvider)
 AssetManager (IServiceProvider serviceProvider, string rootDirectory)
override T Load< T > (string assetName)
LoadUniqueCopy< T > (string assetName)
void UnloadAsset (string name)
StringType GetID ()
void SetID (string ID)
 AssetManager (IServiceProvider serviceProvider)
 AssetManager (IServiceProvider serviceProvider, string rootDirectory)
override T Load< T > (string assetName)
LoadUniqueCopy< T > (string assetName)
void UnloadAsset (string name)
StringType GetID ()
void SetID (string ID)

Protected Attributes

StringType m_ID
 ID that represents the asset manager. If null then it is a unnamed mananger.

Private Member Functions

void RecordDisposableAsset (IDisposable asset)
void RecordDisposableAsset (IDisposable asset)
void RecordDisposableAsset (IDisposable asset)
void RecordDisposableAsset (IDisposable asset)

Private Attributes

Dictionary< string, object > m_assets = new Dictionary<string, object>()
 Stores the loaded content.
List< IDisposable > m_disposableAssets = new List<IDisposable>()
 Stores which assets are loaded as being disposable.

Detailed Description

Generic way to load, store, destroy assets.


Constructor & Destructor Documentation

Libraries.AssetManager.AssetManager ( IServiceProvider  serviceProvider)

Constructor.

serviceProvider - Services to hook the asset manager into.
Libraries.AssetManager.AssetManager ( IServiceProvider  serviceProvider,
string  rootDirectory 
)

Constructor. Set a root directory.

serviceProvider - Services to hook the asset manager into.
rootDirectory - Root directory to use when loading assets.
Libraries.AssetManager.AssetManager ( IServiceProvider  serviceProvider)

Constructor.

serviceProvider - Services to hook the asset manager into.
Libraries.AssetManager.AssetManager ( IServiceProvider  serviceProvider,
string  rootDirectory 
)

Constructor. Set a root directory.

serviceProvider - Services to hook the asset manager into.
rootDirectory - Root directory to use when loading assets.
Libraries.AssetManager.AssetManager ( IServiceProvider  serviceProvider)

Constructor.

serviceProvider - Services to hook the asset manager into.
Libraries.AssetManager.AssetManager ( IServiceProvider  serviceProvider,
string  rootDirectory 
)

Constructor. Set a root directory.

serviceProvider - Services to hook the asset manager into.
rootDirectory - Root directory to use when loading assets.
Libraries.AssetManager.AssetManager ( IServiceProvider  serviceProvider)

Constructor.

serviceProvider - Services to hook the asset manager into.
Libraries.AssetManager.AssetManager ( IServiceProvider  serviceProvider,
string  rootDirectory 
)

Constructor. Set a root directory.

serviceProvider - Services to hook the asset manager into.
rootDirectory - Root directory to use when loading assets.

Member Function Documentation

new void Libraries.AssetManager.Dispose ( )

Cleans up all the assets in the manager. Cleans up the tracked and untracked. This should only be called if the asset manager it going to be deleted.

StringType Libraries.AssetManager.GetID ( )

Gets the ID of the asset manager.

Return:
Value is the ID of the manager if it is named, null if not named.

StringType Libraries.AssetManager.GetID ( )

Gets the ID of the asset manager.

Return:
Value is the ID of the manager if it is named, null if not named.

StringType Libraries.AssetManager.GetID ( )

Gets the ID of the asset manager.

Return:
Value is the ID of the manager if it is named, null if not named.

StringType Libraries.AssetManager.GetID ( )

Gets the ID of the asset manager.

Return:
Value is the ID of the manager if it is named, null if not named.

override T Libraries.AssetManager.Load< T > ( string  assetName)

Load the assets with the given name. If a asset with the same name is already loaded, nothing will be loaded. /par assetName - Name of the asset to load.
Return:
Value is the asset if loaded/already loaded or null if something went wrong.

override T Libraries.AssetManager.Load< T > ( string  assetName)

Load the assets with the given name. If a asset with the same name is already loaded, nothing will be loaded.

assetName - Name of the asset to load.

Return:
Value is the asset if loaded/already loaded or null if something went wrong.
override T Libraries.AssetManager.Load< T > ( string  assetName)

Load the assets with the given name. If a asset with the same name is already loaded, nothing will be loaded.

assetName - Name of the asset to load.

Return:
Value is the asset if loaded/already loaded or null if something went wrong.
override T Libraries.AssetManager.Load< T > ( string  assetName)

Load the assets with the given name. If a asset with the same name is already loaded, nothing will be loaded. /par assetName - Name of the asset to load.
Return:
Value is the asset if loaded/already loaded or null if something went wrong.

T Libraries.AssetManager.LoadUniqueCopy< T > ( string  assetName)

Load a unique clean version of the asset. This way you can have multiple editable versions of the same asset. This version does not get stored in the manager in the derived manager, so it can only be destroyed by clearing the base manager.

assetName - Name of the asset to load.

Return:
Value is the asset if it loaded, null if something went wrong.
T Libraries.AssetManager.LoadUniqueCopy< T > ( string  assetName)

Load a unique clean version of the asset. This way you can have multiple editable versions of the same asset. This version does not get stored in the manager in the derived manager, so it can only be destroyed by clearing the base manager. /par assetName - Name of the asset to load.
Return:
Value is the asset if it loaded, null if something went wrong.

T Libraries.AssetManager.LoadUniqueCopy< T > ( string  assetName)

Load a unique clean version of the asset. This way you can have multiple editable versions of the same asset. This version does not get stored in the manager in the derived manager, so it can only be destroyed by clearing the base manager. /par assetName - Name of the asset to load.
Return:
Value is the asset if it loaded, null if something went wrong.

T Libraries.AssetManager.LoadUniqueCopy< T > ( string  assetName)

Load a unique clean version of the asset. This way you can have multiple editable versions of the same asset. This version does not get stored in the manager in the derived manager, so it can only be destroyed by clearing the base manager.

assetName - Name of the asset to load.

Return:
Value is the asset if it loaded, null if something went wrong.
void Libraries.AssetManager.RecordDisposableAsset ( IDisposable  asset) [private]

Store a given asset as disposable.

asset - Asset to store.
void Libraries.AssetManager.RecordDisposableAsset ( IDisposable  asset) [private]

Store a given asset as disposable.

asset - Asset to store.
void Libraries.AssetManager.RecordDisposableAsset ( IDisposable  asset) [private]

Store a given asset as disposable.

asset - Asset to store.
void Libraries.AssetManager.RecordDisposableAsset ( IDisposable  asset) [private]

Store a given asset as disposable.

asset - Asset to store.
void Libraries.AssetManager.SetID ( string  ID)

Sets the manager ID to the given ID.

ID - ID to use.
void Libraries.AssetManager.SetID ( string  ID)

Sets the manager ID to the given ID.

ID - ID to use.
void Libraries.AssetManager.SetID ( string  ID)

Sets the manager ID to the given ID.

ID - ID to use.
void Libraries.AssetManager.SetID ( string  ID)

Sets the manager ID to the given ID.

ID - ID to use.
void Libraries.AssetManager.UnloadAsset ( string  name)

Unload a stored asset with the given name. Does nothing if the asset doesn't exist.

name - Name of the asset to unload.
void Libraries.AssetManager.UnloadAsset ( string  name)

Unload a stored asset with the given name. Does nothing if the asset doesn't exist.

name - Name of the asset to unload.
void Libraries.AssetManager.UnloadAsset ( string  name)

Unload a stored asset with the given name. Does nothing if the asset doesn't exist.

name - Name of the asset to unload.
rootDirectory - Root directory to use when loading assets.
void Libraries.AssetManager.UnloadAsset ( string  name)

Unload a stored asset with the given name. Does nothing if the asset doesn't exist.

name - Name of the asset to unload.
rootDirectory - Root directory to use when loading assets.
void Libraries.AssetManager.UnloadTrackedAssets ( )

Cleans up all the assets in the manager that are being tracked. This is not the same as Dispose. Dispose should only be called once, ever, on the asset manager. Only assets loaded with the overloaded Load function will be cleaned up. Also calls the base dispose function. Always use this, never Dispose().


Member Data Documentation

Dictionary< string, object > Libraries.AssetManager::m_assets = new Dictionary<string, object>() [private]

Stores the loaded content.

List< IDisposable > Libraries.AssetManager::m_disposableAssets = new List<IDisposable>() [private]

Stores which assets are loaded as being disposable.

ID that represents the asset manager. If null then it is a unnamed mananger.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Properties