Class ResourceCatalog
Ladybug ResourceCatalog instance
Inheritance
Inherited Members
Namespace: Ladybug
Assembly: ladybug.dll
Syntax
public class ResourceCatalog
Constructors
| Improve this Doc View SourceResourceCatalog(ContentManager)
Creates a new RsourceCatalog instance
Declaration
public ResourceCatalog(ContentManager contentManager)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xna.Framework.Content.ContentManager | contentManager | ContentManager to be used by the ResourceCatalog when loading content resources |
Properties
| Improve this Doc View SourceContentManager
ResourceCatalog's resident ContentManager
Declaration
public ContentManager ContentManager { get; }
Property Value
Type | Description |
---|---|
Microsoft.Xna.Framework.Content.ContentManager |
Methods
| Improve this Doc View SourceGetResource<T>(String)
Gets the given resource from the ResourceCatalog
Declaration
public T GetResource<T>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of resource |
Returns
Type | Description |
---|---|
T | Requested resource |
Type Parameters
Name | Description |
---|---|
T | Type of resource |
LoadResource<T>(String, String)
Loads a resource into the ResourceCatalog
Declaration
public T LoadResource<T>(string identifier, string source)
Parameters
Type | Name | Description |
---|---|---|
System.String | identifier | Name of new resource |
System.String | source | Path to resource |
Returns
Type | Description |
---|---|
T | Resource loaded from given path |
Type Parameters
Name | Description |
---|---|
T | Type of resource |
ResourceExists<T>(String)
Checks to see if resource exists
Declaration
public bool ResourceExists<T>(string identifier)
Parameters
Type | Name | Description |
---|---|---|
System.String | identifier | Name of resource |
Returns
Type | Description |
---|---|
System.Boolean | True if resource exists, False if resource not found. |
Type Parameters
Name | Description |
---|---|
T | Type of resource |
SaveResource<T>(String, T)
Saves an already loaded resource to the ResourceCatalog
Declaration
public void SaveResource<T>(string identifier, T resource)
Parameters
Type | Name | Description |
---|---|---|
System.String | identifier | Name of resource |
T | resource | Resource to save |
Type Parameters
Name | Description |
---|---|
T | Type of resource |
TryGetResource<T>(String, out T)
Attempts to find the given resource in this ResourceCatalog
Declaration
public bool TryGetResource<T>(string name, out T resource)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of resource |
T | resource | Reference to resource, if found |
Returns
Type | Description |
---|---|
System.Boolean | True if resource is found, False otherwise |
Type Parameters
Name | Description |
---|---|
T | Type of resource |