33 lines
635 B
C#
33 lines
635 B
C#
using System;
|
|
|
|
namespace DebuggingEssentials
|
|
{
|
|
public struct ItemHolder<T, U> : IComparable<ItemHolder<T, U>> where T : IComparable<T> where U : IComparable<U>
|
|
{
|
|
public static CompareMode compareMode;
|
|
|
|
public T key;
|
|
|
|
public U value;
|
|
|
|
public ItemHolder(T key, U value)
|
|
{
|
|
this.key = key;
|
|
this.value = value;
|
|
}
|
|
|
|
public int CompareTo(ItemHolder<T, U> other)
|
|
{
|
|
if (compareMode == CompareMode.Key)
|
|
{
|
|
ref T reference = ref key;
|
|
T other2 = other.key;
|
|
return reference.CompareTo(other2);
|
|
}
|
|
ref U reference2 = ref value;
|
|
U other3 = other.value;
|
|
return reference2.CompareTo(other3);
|
|
}
|
|
}
|
|
}
|