Struct GorgonChunk
A chunk for the chunked file format.
Inherited Members
Namespace: Gorgon.IO
Assembly: Gorgon.Core.dll
Syntax
public readonly struct GorgonChunk : IGorgonEquatableByRef<GorgonChunk>, IEquatable<GorgonChunk>
Constructors
| Edit this page View SourceGorgonChunk(ulong, int, ulong)
Initializes a new instance of the GorgonChunk struct.
Declaration
public GorgonChunk(ulong id, int size, ulong offset)
Parameters
Type | Name | Description |
---|---|---|
ulong | id | The identifier for the chunk. |
int | size | The size of the chunk, in bytes. |
ulong | offset | The offset within the file, in bytes. |
Fields
| Edit this page View SourceEmptyChunk
An empty chunk.
Declaration
public static readonly GorgonChunk EmptyChunk
Field Value
Type | Description |
---|---|
GorgonChunk |
FileOffset
The offset, in bytes, of the chunk within the chunked file.
Declaration
public readonly ulong FileOffset
Field Value
Type | Description |
---|---|
ulong |
Remarks
This is relative to the header of the file.
ID
The ID for the chunk.
Declaration
public readonly ulong ID
Field Value
Type | Description |
---|---|
ulong |
Size
The size of the chunk, in bytes.
Declaration
public readonly int Size
Field Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceEquals(GorgonChunk)
Function to compare two instances for equality.
Declaration
public bool Equals(GorgonChunk other)
Parameters
Type | Name | Description |
---|---|---|
GorgonChunk | other | The object of type GorgonChunk to compare. |
Returns
Type | Description |
---|---|
bool | true if equal, false otherwise. |
Equals(in GorgonChunk)
Function to compare this instance with another.
Declaration
public bool Equals(in GorgonChunk other)
Parameters
Type | Name | Description |
---|---|---|
GorgonChunk | other | The other instance to use for comparison. |
Returns
Type | Description |
---|---|
bool | true if equal, false if not. |
Equals(in GorgonChunk, in GorgonChunk)
Function to compare two instances for equality.
Declaration
public static bool Equals(in GorgonChunk left, in GorgonChunk right)
Parameters
Type | Name | Description |
---|---|---|
GorgonChunk | left | The first object of type GorgonChunk to compare. |
GorgonChunk | right | The second object of type GorgonChunk to compare. |
Returns
Type | Description |
---|---|
bool | true if the specified objects are equal; otherwise, false if not. |
Equals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
bool | true if the specified object is equal to this instance; otherwise, false. |
Overrides
| Edit this page View SourceGetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
| Edit this page View SourceToString()
Returns a string that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents this instance. |
Overrides
Operators
| Edit this page View Sourceoperator ==(in GorgonChunk, in GorgonChunk)
Operator used to compare two instances for equality.
Declaration
public static bool operator ==(in GorgonChunk left, in GorgonChunk right)
Parameters
Type | Name | Description |
---|---|---|
GorgonChunk | left | The left instance to compare. |
GorgonChunk | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if equal, false otherwise. |
operator !=(in GorgonChunk, in GorgonChunk)
Operator used to compare two instances for inequality.
Declaration
public static bool operator !=(in GorgonChunk left, in GorgonChunk right)
Parameters
Type | Name | Description |
---|---|---|
GorgonChunk | left | The left instance to compare. |
GorgonChunk | right | The right instance to compare. |
Returns
Type | Description |
---|---|
bool | true if not equal, false otherwise. |