Class TextureComparators
Provides methods for comparing and hashing ITexture instances.
Namespace: TriLibCore.Utils
Assembly: TriLibCore.Source.dll
Syntax
public static class TextureComparators
Methods
Equals(ITexture, object)
Determines whether an ITexture instance is equal to the specified object.
Declaration
public static bool Equals(ITexture a, object b)
Parameters
| Type | Name | Description |
|---|---|---|
| ITexture | a | The texture to compare. |
| object | b | The object to compare against. |
Returns
| Type | Description |
|---|---|
| bool | true if |
GetHashCode(ITexture)
Generates a hash code for the specified ITexture using its short file name, falling back to its name when the texture has no file name.
Declaration
public static int GetHashCode(ITexture a)
Parameters
| Type | Name | Description |
|---|---|---|
| ITexture | a | The texture for which to generate a hash code. |
Returns
| Type | Description |
|---|---|
| int | An integer hash code suitable for use in data structures like hash tables, or zero if |
TextureEquals(ITexture, ITexture)
Determines whether two ITexture instances represent the same texture. Textures having a file name are compared by their short file names, and only textures without a file name are compared by their names.
Declaration
public static bool TextureEquals(ITexture a, ITexture b)
Parameters
| Type | Name | Description |
|---|---|---|
| ITexture | a | The first texture to compare. |
| ITexture | b | The second texture to compare. |
Returns
| Type | Description |
|---|---|
| bool | true if both textures are considered equal; otherwise, false. |