forked from bltavares/ScoreSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompareScore.cs
More file actions
30 lines (27 loc) · 744 Bytes
/
CompareScore.cs
File metadata and controls
30 lines (27 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ScoreSharp
{
public class CompareScore : IComparer<string>
{
string match;
public CompareScore(string match)
{
this.match = match;
}
public int Compare(string obj1, string obj2)
{
int retorno;
double comparison = Scorer.score(obj2.ToString(), this.match) - Scorer.score(obj1.ToString(), this.match);
if (comparison > 0)
retorno = 1;
else if (comparison < 0)
retorno = -1;
else
retorno = 0;
return retorno;
}
}
}