You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
504 B
26 lines
504 B
3 years ago
|
using UnityEngine;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using System;
|
||
|
using System.ComponentModel;
|
||
|
|
||
|
namespace UIWidgets {
|
||
|
public class ComparisonComparer<T> : IComparer<T>
|
||
|
{
|
||
|
readonly Comparison<T> comparison;
|
||
|
|
||
|
public ComparisonComparer(Comparison<T> newComparison)
|
||
|
{
|
||
|
if (newComparison==null)
|
||
|
{
|
||
|
throw new ArgumentNullException("newComparison");
|
||
|
}
|
||
|
comparison = newComparison;
|
||
|
}
|
||
|
|
||
|
public int Compare(T x, T y)
|
||
|
{
|
||
|
return comparison(x, y);
|
||
|
}
|
||
|
}
|
||
|
}
|