Class EngineResourceSet

java.lang.Object
com.blackrook.engine.EngineResourceSet

public class EngineResourceSet extends Object
The thing that holds and manages all engine resources (by class).
Author:
Matthew Tropiano
  • Method Details

    • addResource

      public <T extends EngineResource> void addResource(T resource)
    • getResourceSet

      public <T extends EngineResource> EngineResourceSet.ResourceSet<T> getResourceSet(Class<T> clazz)
      Returns the resource list that stores a set of resources.
      Type Parameters:
      T - the type contained by the list.
      Parameters:
      clazz - the resource class to retrieve the list of.
      Returns:
      the corresponding list of resources, or null if no corresponding set.
    • getResource

      public <T extends EngineResource> T getResource(Class<T> clazz, String id)
      Returns a resource of a particular type and id.
      Type Parameters:
      T - the type contained by the list.
      Parameters:
      clazz - the resource class to retrieve the list of.
      id - the id of the resource to fetch.
      Returns:
      the corresponding resource, or null if no corresponding set or id.