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

@ -118,7 +118,7 @@ namespace Server.Mobiles
#endregion
public class DamageStore : IComparable
public class DamageStore : IComparable<DamageStore>
{
public int m_Damage;
public bool m_HasRight;
@ -130,12 +130,9 @@ namespace Server.Mobiles
m_Damage = damage;
}
public int CompareTo(object obj)
public int CompareTo(DamageStore ds)
{
if (!(obj is DamageStore ds))
return -1;
return ds.m_Damage - m_Damage;
return ds?.m_Damage ?? 0 - m_Damage;
}
}
@ -157,11 +154,7 @@ namespace Server.Mobiles
object[] objs = t.GetCustomAttributes(typeof(FriendlyNameAttribute), false);
if (objs.Length > 0)
{
FriendlyNameAttribute friendly = objs[0] as FriendlyNameAttribute;
return friendly?.FriendlyName ?? "";
}
return (objs[0] as FriendlyNameAttribute)?.FriendlyName ?? "";
}
return t.Name;