/// <summary> /// Loads a resource. Resource will be subclasses of Resource. /// </summary> /// <param name="resource">Resource to load.</param> /// <param name="priority"></param> public virtual void Load(Resource resource, int priority) { // load and touch the resource resource.Load(); resource.Touch(); // cache the resource Add(resource); }
/// <summary> /// Gets a resource with the given handle. /// </summary> /// <param name="handle">Handle of the resource to retrieve.</param> /// <returns>A reference to a Resource with the given handle.</returns> public virtual Resource GetByHandle(int handle) { Debug.Assert(resourceHandleMap != null, "A resource was being retreived, but the list of Resources is null.", ""); Resource resource = null; // find the resource in the Hashtable and return it if (resourceHandleMap[handle] != null) { resource = (Resource)resourceHandleMap[handle]; resource.Touch(); } return(resource); }
/// <summary> /// Loads a resource. Resource will be subclasses of Resource. /// </summary> /// <param name="resource">Resource to load.</param> /// <param name="priority"></param> public virtual void Load(Resource resource, int priority) { // load and touch the resource resource.Load(); resource.Touch(); // cache the resource Add(resource); }