Show / Hide Table of Contents

Class IDComparer<T>

Class intended for comparing/hashing objects that implement IHasID. Type T must be a reference type.

Inheritance
object
IDComparer<T>
Implements
IEqualityComparer<T>
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: SadRogue.Primitives.SpatialMaps
Assembly: TheSadRogue.Primitives.dll
Syntax
public class IDComparer<T> : IEqualityComparer<T> where T : class, IHasID
Type Parameters
Name Description
T

Type of object being compared. Type T must be a reference type that implements IHasID.

Constructors

View Source

IDComparer()

Declaration
public IDComparer()

Methods

View Source

Equals(T?, T?)

Equality comparison. Performs comparison via the object's ReferenceEquals(object, object) function.

Declaration
public bool Equals(T? x, T? y)
Parameters
Type Name Description
T x

First object to compare.

T y

Second object to compare.

Returns
Type Description
bool

True if the objects are considered equal, false otherwise.

View Source

GetHashCode(T)

Generates a hash based on the object's ID.GetHashCode() function.

Declaration
public int GetHashCode(T obj)
Parameters
Type Name Description
T obj

Object to generate the hash for.

Returns
Type Description
int

The hash of the object, based on its ID.

Implements

IEqualityComparer<T>

Extension Methods

PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>?)
PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>?, EventHandler<ValueChangedEventArgs<TProperty>>?)
  • View Source
In this article
Back to top Generated by DocFX