Removes old comparable/comparers. (#31)

This commit is contained in:
Kamron Batman 2019-03-11 15:35:04 -07:00 • committed by GitHub
parent 513e54f70e
commit a45094f2dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 95 additions and 249 deletions

View file

@ -1116,7 +1116,7 @@ namespace Server.Engines.ConPVP
}
}
public sealed class BRPlayerInfo : IRankedCTF, IComparable
public sealed class BRPlayerInfo : IRankedCTF, IComparable<BRPlayerInfo>
{
private int m_Captures;
@ -1133,17 +1133,16 @@ namespace Server.Engines.ConPVP
public Mobile Player{ get; }
public int CompareTo(object obj)
public int CompareTo(BRPlayerInfo pi)
{
BRPlayerInfo pi = (BRPlayerInfo)obj;
int res = pi.Captures.CompareTo(Captures);
if (res == 0)
{
res = pi.Score.CompareTo(Score);
if (res != 0)
return res;
if (res == 0)
res = pi.Kills.CompareTo(Kills);
}
res = pi.Score.CompareTo(Score);
if (res == 0)
res = pi.Kills.CompareTo(Kills);
return res;
}