/// <summary> /// A SCI32 Resource Directory /// </summary> /// <param name="res">the type of resource</param> /// <param name="offset">the offset that holds all resources of this type</param> /// <param name="fromResourceFile">the resource file location</param> public SCI32ResourceDirectory(byte res, uint offset, string fromResourceFile) { this.Type = SCI32Resource.GetResourceType(res); this.Offset = offset; this.Resources = new SCI32ResourceCollection(); this.ResourceFileLocation = fromResourceFile; this.ResourceFileName = fromResourceFile.Split('\\').Last(); }
/// <summary> /// Trys to get a resource from our collection by index, returns a null resource if it fails. /// </summary> /// <param name="index"></param> /// <param name="resource"></param> /// <returns></returns> public bool TryGetResourceByIndex(int index, out SCI32Resource resource) { resource = null; try { resource = this.Resources[index]; } catch { } return(resource != null); }
/// <summary> /// Adds a resource to our collection list. /// </summary> /// <param name="res"></param> public void AddResource(SCI32Resource res) { this.Resources.Add(res); }