Removes old comparable/comparers. (#31)
This commit is contained in:
parent
513e54f70e
commit
a45094f2dc
23 changed files with 95 additions and 249 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue