Struct CompoundMaterialKey
Represents a compound key composed of a material reference and a texture type.
Namespace: TriLibCore.General
Assembly: TriLibCore.Source.dll
Syntax
public struct CompoundMaterialKey
Remarks
This key is typically used in dictionaries or hash-based collections where both the material instance and the texture type must be considered to uniquely identify an entry.
Constructors
CompoundMaterialKey(IMaterial, TextureType)
Initializes a new instance of the CompoundMaterialKey struct.
Declaration
public CompoundMaterialKey(IMaterial material, TextureType type)
Parameters
| Type | Name | Description |
|---|---|---|
| IMaterial | material | The material component of the key. |
| TextureType | type | The texture type component of the key. |
Fields
Material
Gets or sets the material associated with this key.
Declaration
public IMaterial Material
Field Value
| Type | Description |
|---|---|
| IMaterial |
Type
Gets or sets the texture type associated with this key.
Declaration
public TextureType Type
Field Value
| Type | Description |
|---|---|
| TextureType |
Methods
Equals(object)
Determines whether this instance is equal to another object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|
Overrides
Equals(CompoundMaterialKey)
Determines whether this instance is equal to another CompoundMaterialKey.
Declaration
public bool Equals(CompoundMaterialKey other)
Parameters
| Type | Name | Description |
|---|---|---|
| CompoundMaterialKey | other | The other key to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|
GetHashCode()
Returns a hash code for this instance based on the material and texture type.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | The computed hash code. |
Overrides
ToString()
Returns a string that represents the current key.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string in the format |