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

@ -4,7 +4,7 @@ using Server.Mobiles;
namespace Server.Factions
{
public class PlayerState : IComparable
public class PlayerState : IComparable<PlayerState>
{
private Town m_Finance;
@ -241,17 +241,14 @@ namespace Server.Factions
public bool IsActive{ get; set; }
public int CompareTo(object obj)
public int CompareTo(PlayerState ps)
{
return ((PlayerState)obj).m_KillPoints - m_KillPoints;
return (ps?.m_KillPoints ?? 0) - m_KillPoints;
}
public bool CanGiveSilverTo(Mobile mob)
{
if (SilverGiven == null)
return true;
for (int i = 0; i < SilverGiven.Count; ++i)
for (int i = 0; i < SilverGiven?.Count; ++i)
{
SilverGivenEntry sge = SilverGiven[i];
@ -307,4 +304,4 @@ namespace Server.Factions
return mob is PlayerMobile mobile ? mobile.FactionPlayerState : null;
}
}
}
}