ResourceIndex
Namespace: Casasoft.IF.GBlorbLib
Represents an index of resources within a chunk.
public class ResourceIndex : Chunk, IChunk
Inheritance Object → Chunk → ResourceIndex
Implements IChunk
Attributes NullableContextAttribute, NullableAttribute
Fields
TotalResourcesCount
Gets or sets the total number of resources.
public int TotalResourcesCount;
ResourcesEntries
Gets or sets the list of resource entries.
public List<ResourceEntry> ResourcesEntries;
Properties
Name
Gets or sets the name of the chunk.
public string Name { get; set; }
Property Value
Length
Gets or sets the length of the chunk.
public int Length { get; set; }
Property Value
Address
Gets or sets the address of the chunk.
public int Address { get; set; }
Property Value
ResourceID
Gets or sets the resource ID of the chunk.
public int ResourceID { get; set; }
Property Value
Constructors
ResourceIndex()
Initializes a new instance of the ResourceIndex class with a default name.
public ResourceIndex()
ResourceIndex(Byte[], Int32)
Initializes a new instance of the ResourceIndex class with the specified data and offset.
public ResourceIndex(Byte[] data, int offset)
Parameters
data
Byte[]
The byte array containing the resource index data.
offset
Int32
The offset within the byte array where the resource index starts.
ResourceIndex(List<IChunk>)
Initializes a new instance of the ResourceIndex class using a list of chunks.
public ResourceIndex(List<IChunk> chunks)
Parameters
chunks
List<IChunk>
The list of chunks to include in the resource index.
Methods
ToString()
Returns a string that represents the current resource index.
public string ToString()
Returns
String
A string that represents the current resource index.
Write(Byte[], Int32)
Writes the resource index data to the specified byte array at the given offset.
public void Write(Byte[] data, int offset)
Parameters
data
Byte[]
The byte array to write the resource index data to.
offset
Int32
The offset within the byte array where the resource index data should be written.
GetResourceNumberByAddress(Int32)
Gets the resource number by its address.
public int GetResourceNumberByAddress(int address)
Parameters
address
Int32
The address of the resource.
Returns
Int32
The resource number if found; otherwise, -1.