public ResourceLocation GetLocation()
{
if ((LocationFlags & ResourceLocationFlags.InResources) != 0)
return ResourceLocation.Resources;
if ((LocationFlags & ResourceLocationFlags.InTextures) != 0)
return ResourceLocation.Textures;
if ((LocationFlags & ResourceLocationFlags.InTexturesB) != 0)
return ResourceLocation.TexturesB;
if ((LocationFlags & ResourceLocationFlags.InAudio) != 0)
return ResourceLocation.Audio;
if ((LocationFlags & ResourceLocationFlags.InVideo) != 0)
return ResourceLocation.Video;
throw new InvalidOperationException("The resource does not have a location flag set");
}
private LoadedCache GetCache(ResourceReference resource) { LoadedCache cache; if (!_loadedCaches.TryGetValue(resource.GetLocation(), out cache)) throw new InvalidOperationException("The requested resource is located in " + resource.GetLocation() + ", but the corresponding cache file has not been loaded."); return cache; }