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

@ -15,10 +15,10 @@ using Server.Targeting;
namespace Server.Factions
{
[CustomEnum(new[] { "Minax", "Council of Mages", "True Britannians", "Shadowlords" })]
public abstract class Faction : IComparable
public abstract class Faction : IComparable<Faction>
{
public const int StabilityFactor = 300; // 300% greater (3 times) than smallest faction
public const int StabilityActivation = 200; // Stablity code goes into effect when largest faction has > 200 people
public const int StabilityActivation = 200; // Stability code goes into effect when largest faction has > 200 people
public static readonly TimeSpan LeavePeriod = TimeSpan.FromDays(3.0);
@ -88,9 +88,9 @@ namespace Server.Factions
public static List<Faction> Factions => Reflector.Factions;
public int CompareTo(object obj)
public int CompareTo(Faction f)
{
return m_Definition.Sort - ((Faction)obj).m_Definition.Sort;
return m_Definition.Sort - (f?.m_Definition.Sort ?? 0);
}
public void Broadcast(string text)