Generated by DocFX

Class ResourceCatalog

Ladybug ResourceCatalog instance

Inheritance
System.Object
ResourceCatalog
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Ladybug
Assembly: ladybug.dll
Syntax
public class ResourceCatalog

Constructors

| Improve this Doc View Source

ResourceCatalog(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 Source

ContentManager

ResourceCatalog's resident ContentManager

Declaration
public ContentManager ContentManager { get; }
Property Value
Type Description
Microsoft.Xna.Framework.Content.ContentManager

Methods

| Improve this Doc View Source

GetResource<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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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

| Improve this Doc View Source

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