From a45094f2dc75869b140daf2700775194a84854fb Mon Sep 17 00:00:00 2001 From: Kamron Batman Date: Mon, 11 Mar 2019 15:35:04 -0700 Subject: [PATCH] Removes old comparable/comparers. (#31) --- Scripts/Accounting/Account.cs | 28 +++++------------ Scripts/Commands/Docs.cs | 3 +- Scripts/Engines/ConPVP/Arena.cs | 13 ++------ Scripts/Engines/ConPVP/Games/BombingRun.cs | 17 +++++----- Scripts/Engines/ConPVP/Games/KingOfTheHill.cs | 31 ++++++------------- Scripts/Engines/ConPVP/Ladder.cs | 6 ++-- Scripts/Engines/Factions/Core/Faction.cs | 8 ++--- Scripts/Engines/Factions/Core/PlayerState.cs | 13 +++----- Scripts/Engines/Factions/Core/Town.cs | 9 ++---- .../Engines/Reports/Objects/Staffing/Info.cs | 17 ++++------ Scripts/Engines/Reports/Reports.cs | 12 +++---- Scripts/Gumps/SkillsGump.cs | 9 ++---- Scripts/Mobiles/BaseCreature.cs | 15 +++------ Server/ClientVersion.cs | 16 +++------- Server/Commands.cs | 14 ++------- Server/Geometry.cs | 20 ------------ Server/IEntity.cs | 17 ++-------- Server/Insensitive.cs | 7 +++-- Server/Item.cs | 23 ++++---------- Server/Items/Container.cs | 7 ++--- Server/Map.cs | 27 ++-------------- Server/Mobile.cs | 21 ++----------- Server/Serial.cs | 11 ++----- 23 files changed, 95 insertions(+), 249 deletions(-) diff --git a/Scripts/Accounting/Account.cs b/Scripts/Accounting/Account.cs index e0b2d5892..1f23a2d22 100644 --- a/Scripts/Accounting/Account.cs +++ b/Scripts/Accounting/Account.cs @@ -11,7 +11,7 @@ using Server.Network; namespace Server.Accounting { - public class Account : IAccount, IComparable, IComparable + public class Account : IAccount, IComparable { public static readonly TimeSpan YoungDuration = TimeSpan.FromHours( 40.0 ); @@ -1121,28 +1121,14 @@ namespace Server.Accounting } public int CompareTo( Account other ) - { - if ( other == null ) - return 1; - - return Username.CompareTo( other.Username ); - } + { + return other == null ? 1 : Username.CompareTo( other.Username ); + } public int CompareTo( IAccount other ) - { - if ( other == null ) - return 1; - - return Username.CompareTo( other.Username ); - } - - public int CompareTo( object obj ) - { - if ( obj is Account account ) - return CompareTo( account ); - - throw new ArgumentException(); - } + { + return other == null ? 1 : Username.CompareTo( other.Username ); + } #region Gold Account /// diff --git a/Scripts/Commands/Docs.cs b/Scripts/Commands/Docs.cs index 104aa2cd9..1b1e5c581 100644 --- a/Scripts/Commands/Docs.cs +++ b/Scripts/Commands/Docs.cs @@ -392,7 +392,8 @@ namespace Server.Commands v = 1; } - if (v == 0) v = GetNameFrom(aCtor, aProp, aMethod).CompareTo(GetNameFrom(bCtor, bProp, bMethod)); + if (v == 0) + v = GetNameFrom(aCtor, aProp, aMethod).CompareTo(GetNameFrom(bCtor, bProp, bMethod)); if (v == 0 && aCtor != null && bCtor != null) v = aCtor.GetParameters().Length.CompareTo(bCtor.GetParameters().Length); diff --git a/Scripts/Engines/ConPVP/Arena.cs b/Scripts/Engines/ConPVP/Arena.cs index d659adedf..f36bd394c 100644 --- a/Scripts/Engines/ConPVP/Arena.cs +++ b/Scripts/Engines/ConPVP/Arena.cs @@ -172,7 +172,7 @@ namespace Server.Engines.ConPVP } [PropertyObject] - public class Arena : IComparable + public class Arena : IComparable { private bool m_Active; private Rectangle2D m_Bounds; @@ -456,10 +456,8 @@ namespace Server.Engines.ConPVP public static List Arenas{ get; } = new List(); - public int CompareTo(object obj) + public int CompareTo(Arena c) { - Arena c = (Arena)obj; - string a = m_Name; string b = c.m_Name; @@ -475,18 +473,13 @@ namespace Server.Engines.ConPVP public Ladder AcquireLadder() { - if (Ladder != null) - return Ladder.Ladder; - - return ConPVP.Ladder.Instance; + return Ladder?.Ladder ?? ConPVP.Ladder.Instance; } public void Delete() { Active = false; - m_Region?.Unregister(); - m_Region = null; } diff --git a/Scripts/Engines/ConPVP/Games/BombingRun.cs b/Scripts/Engines/ConPVP/Games/BombingRun.cs index ef6edc49c..c41cfb333 100644 --- a/Scripts/Engines/ConPVP/Games/BombingRun.cs +++ b/Scripts/Engines/ConPVP/Games/BombingRun.cs @@ -1116,7 +1116,7 @@ namespace Server.Engines.ConPVP } } - public sealed class BRPlayerInfo : IRankedCTF, IComparable + public sealed class BRPlayerInfo : IRankedCTF, IComparable { 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; } diff --git a/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs b/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs index 099965cd6..f93023b88 100644 --- a/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs +++ b/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs @@ -555,7 +555,7 @@ namespace Server.Engines.ConPVP } [PropertyObject] - public sealed class KHTeamInfo : IRankedCTF, IComparable + public sealed class KHTeamInfo : IRankedCTF, IComparable { public KHTeamInfo(int teamID) { @@ -609,30 +609,21 @@ namespace Server.Engines.ConPVP [CommandProperty(AccessLevel.GameMaster)] public string TeamName{ get; set; } - public int CompareTo(object obj) + public int CompareTo(KHTeamInfo ti) { - KHTeamInfo ti = (KHTeamInfo)obj; int res = ti.Score.CompareTo(Score); - if (res == 0) - { - res = ti.Captures.CompareTo(Captures); + if (res != 0) + return res; - if (res == 0) - res = ti.Kills.CompareTo(Kills); - } + res = ti.Captures.CompareTo(Captures); + + if (res == 0) + res = ti.Kills.CompareTo(Kills); return res; } - public string Name - { - get - { - if (TeamName == null) - return "(null) Team"; - return $"{TeamName} Team"; - } - } + public string Name => $"{TeamName ?? "(none)"} Team"; public int Kills{ get; set; } @@ -661,9 +652,7 @@ namespace Server.Engines.ConPVP public override string ToString() { - if (TeamName != null) - return $"({Name}) ..."; - return "..."; + return TeamName != null ? $"({Name}) ..." : "..."; } } diff --git a/Scripts/Engines/ConPVP/Ladder.cs b/Scripts/Engines/ConPVP/Ladder.cs index 01be31f5d..8457abd69 100644 --- a/Scripts/Engines/ConPVP/Ladder.cs +++ b/Scripts/Engines/ConPVP/Ladder.cs @@ -296,7 +296,7 @@ namespace Server.Engines.ConPVP } } - public class LadderEntry : IComparable + public class LadderEntry : IComparable { private int m_Experience; private Ladder m_Ladder; @@ -350,9 +350,9 @@ namespace Server.Engines.ConPVP [CommandProperty(AccessLevel.GameMaster)] public int Rank => Index; - public int CompareTo(object obj) + public int CompareTo(LadderEntry l) { - return ((LadderEntry)obj).m_Experience - m_Experience; + return (l?.m_Experience ?? 0) - m_Experience; } public void Serialize(GenericWriter writer) diff --git a/Scripts/Engines/Factions/Core/Faction.cs b/Scripts/Engines/Factions/Core/Faction.cs index 786655380..d7d708aae 100644 --- a/Scripts/Engines/Factions/Core/Faction.cs +++ b/Scripts/Engines/Factions/Core/Faction.cs @@ -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 { 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 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) diff --git a/Scripts/Engines/Factions/Core/PlayerState.cs b/Scripts/Engines/Factions/Core/PlayerState.cs index 7f43fa40c..67e8fb963 100644 --- a/Scripts/Engines/Factions/Core/PlayerState.cs +++ b/Scripts/Engines/Factions/Core/PlayerState.cs @@ -4,7 +4,7 @@ using Server.Mobiles; namespace Server.Factions { - public class PlayerState : IComparable + public class PlayerState : IComparable { 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; } } -} \ No newline at end of file +} diff --git a/Scripts/Engines/Factions/Core/Town.cs b/Scripts/Engines/Factions/Core/Town.cs index 3310a328f..4bca45747 100644 --- a/Scripts/Engines/Factions/Core/Town.cs +++ b/Scripts/Engines/Factions/Core/Town.cs @@ -6,7 +6,7 @@ using Server.Targeting; namespace Server.Factions { [CustomEnum(new[] { "Britain", "Magincia", "Minoc", "Moonglow", "Skara Brae", "Trinsic", "Vesper", "Yew" })] - public abstract class Town : IComparable, IComparable + public abstract class Town : IComparable { public const int SilverCaptureBonus = 10000; @@ -134,12 +134,7 @@ namespace Server.Factions public int CompareTo(Town other) { - return Definition.Sort - other.Definition.Sort; - } - - public int CompareTo(object obj) - { - return Definition.Sort - ((Town)obj).Definition.Sort; + return Definition.Sort - (other?.Definition.Sort ?? 0); } public static Town FromRegion(Region reg) diff --git a/Scripts/Engines/Reports/Objects/Staffing/Info.cs b/Scripts/Engines/Reports/Objects/Staffing/Info.cs index 9bcbd5813..5f7d395d3 100644 --- a/Scripts/Engines/Reports/Objects/Staffing/Info.cs +++ b/Scripts/Engines/Reports/Objects/Staffing/Info.cs @@ -3,7 +3,7 @@ using Server.Accounting; namespace Server.Engines.Reports { - public abstract class BaseInfo : IComparable + public abstract class BaseInfo : IComparable { private string m_Display; @@ -51,19 +51,14 @@ namespace Server.Engines.Reports } } - public int CompareTo(object obj) + public int CompareTo(BaseInfo cmp) { - BaseInfo cmp = obj as BaseInfo; - - int v = cmp.GetPageCount(cmp is StaffInfo ? PageResolution.Handled : PageResolution.None, - DateTime.UtcNow - SortRange, DateTime.UtcNow) + int v = cmp?.GetPageCount(cmp is StaffInfo ? PageResolution.Handled : PageResolution.None, + DateTime.UtcNow - SortRange, DateTime.UtcNow) ?? 0 - GetPageCount(this is StaffInfo ? PageResolution.Handled : PageResolution.None, DateTime.UtcNow - SortRange, DateTime.UtcNow); - if (v == 0) - v = string.Compare(Display, cmp.Display); - - return v; + return v == 0 ? string.Compare(Display, cmp.Display) : v; } public int GetPageCount(PageResolution res, DateTime min, DateTime max) @@ -95,4 +90,4 @@ namespace Server.Engines.Reports { } } -} \ No newline at end of file +} diff --git a/Scripts/Engines/Reports/Reports.cs b/Scripts/Engines/Reports/Reports.cs index 6031133b4..2b7d08eaf 100644 --- a/Scripts/Engines/Reports/Reports.cs +++ b/Scripts/Engines/Reports/Reports.cs @@ -133,7 +133,7 @@ namespace Server.Engines.Reports if (ladder == null) return chart; - + List entries = ladder.Entries; for (int i = entries.Count - 1; i >= 0; --i) @@ -205,7 +205,7 @@ namespace Server.Engines.Reports if (prefs == null) return chart; - + List arenas = Arena.Arenas; for (int i = 0; i < arenas.Count; ++i) @@ -528,7 +528,7 @@ namespace Server.Engines.Reports return report; } - public class SkillDistribution : IComparable + public class SkillDistribution : IComparable { public int m_NumberOfGMs; public SkillInfo m_Skill; @@ -538,10 +538,10 @@ namespace Server.Engines.Reports m_Skill = skill; } - public int CompareTo(object obj) + public int CompareTo(SkillDistribution sd) { - return ((SkillDistribution)obj).m_NumberOfGMs - m_NumberOfGMs; + return sd?.m_NumberOfGMs ?? 0 - m_NumberOfGMs; } } } -} \ No newline at end of file +} diff --git a/Scripts/Gumps/SkillsGump.cs b/Scripts/Gumps/SkillsGump.cs index 2a36648ea..24725e13d 100644 --- a/Scripts/Gumps/SkillsGump.cs +++ b/Scripts/Gumps/SkillsGump.cs @@ -1,5 +1,5 @@ using System; -using System.Collections; +using System.Collections.Generic; using Server.Commands; using Server.Network; @@ -542,13 +542,10 @@ namespace Server.Gumps }) }; - private class SkillNameComparer : IComparer + private class SkillNameComparer : IComparer { - public int Compare(object x, object y) + public int Compare(SkillName a, SkillName b) { - SkillName a = (SkillName)x; - SkillName b = (SkillName)y; - string aName = SkillInfo.Table[(int)a].Name; string bName = SkillInfo.Table[(int)b].Name; diff --git a/Scripts/Mobiles/BaseCreature.cs b/Scripts/Mobiles/BaseCreature.cs index bd17b4cd8..8fb55e7d9 100644 --- a/Scripts/Mobiles/BaseCreature.cs +++ b/Scripts/Mobiles/BaseCreature.cs @@ -118,7 +118,7 @@ namespace Server.Mobiles #endregion - public class DamageStore : IComparable + public class DamageStore : IComparable { 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; diff --git a/Server/ClientVersion.cs b/Server/ClientVersion.cs index ade8cb130..738a4b502 100644 --- a/Server/ClientVersion.cs +++ b/Server/ClientVersion.cs @@ -161,10 +161,10 @@ namespace Server return Compare(l, r) < 0; } -// public override int GetHashCode() -// { -// return Major ^ Minor ^ Revision ^ Patch ^ (int)Type; -// } + public override int GetHashCode() + { + return Major ^ Minor ^ Revision ^ Patch ^ (int)Type; + } int IComparer.Compare(ClientVersion x, ClientVersion y) { @@ -173,15 +173,9 @@ namespace Server public override bool Equals(object obj) { - if (obj == null) - return false; - ClientVersion v = obj as ClientVersion; - if (v == null) - return false; - - return Major == v.Major + return Major == v?.Major && Minor == v.Minor && Revision == v.Revision && Patch == v.Patch diff --git a/Server/Commands.cs b/Server/Commands.cs index 30fa7727d..933cf7d86 100644 --- a/Server/Commands.cs +++ b/Server/Commands.cs @@ -95,7 +95,7 @@ namespace Server.Commands } } - public class CommandEntry : IComparable + public class CommandEntry : IComparable { public CommandEntry(string command, CommandEventHandler handler, AccessLevel accessLevel) { @@ -110,17 +110,9 @@ namespace Server.Commands public AccessLevel AccessLevel{ get; } - public int CompareTo(object obj) + public int CompareTo(CommandEntry e) { - if (obj == this) - return 0; - if (obj == null) - return 1; - - if (!(obj is CommandEntry e)) - throw new ArgumentException(); - - return Command.CompareTo(e.Command); + return e == null ? 1 : Command.CompareTo(e.Command); } } diff --git a/Server/Geometry.cs b/Server/Geometry.cs index 99992003a..286ad4b74 100644 --- a/Server/Geometry.cs +++ b/Server/Geometry.cs @@ -84,16 +84,6 @@ namespace Server return v; } - public int CompareTo(object other) - { - if (other is Point2D d) - return CompareTo(d); - if (other == null) - return -1; - - throw new ArgumentException(); - } - public override bool Equals(object o) { return o is IPoint2D p && m_X == p.X && m_Y == p.Y; @@ -301,16 +291,6 @@ namespace Server return v; } - - public int CompareTo(object other) - { - if (other is Point3D d) - return CompareTo(d); - if (other == null) - return -1; - - throw new ArgumentException(); - } } [NoSort] diff --git a/Server/IEntity.cs b/Server/IEntity.cs index 1661ee785..09f807249 100644 --- a/Server/IEntity.cs +++ b/Server/IEntity.cs @@ -22,7 +22,7 @@ using System; namespace Server { - public interface IEntity : IPoint3D, IComparable, IComparable + public interface IEntity : IPoint3D, IComparable { Serial Serial{ get; } Point3D Location{ get; } @@ -51,18 +51,7 @@ namespace Server public int CompareTo(IEntity other) { - if (other == null) - return -1; - - return Serial.CompareTo(other.Serial); - } - - public int CompareTo(object other) - { - if (other == null || other is IEntity) - return CompareTo((IEntity)other); - - throw new ArgumentException(); + return other == null ? -1 : Serial.CompareTo(other.Serial); } public Serial Serial{ get; } @@ -93,4 +82,4 @@ namespace Server { } } -} \ No newline at end of file +} diff --git a/Server/Insensitive.cs b/Server/Insensitive.cs index 164c758a5..affe68f78 100644 --- a/Server/Insensitive.cs +++ b/Server/Insensitive.cs @@ -18,13 +18,14 @@ * ***************************************************************************/ -using System.Collections; +using System; +using System.Collections.Generic; namespace Server { public static class Insensitive { - public static IComparer Comparer{ get; } = CaseInsensitiveComparer.Default; + public static IComparer Comparer{ get; } = StringComparer.OrdinalIgnoreCase; public static int Compare(string a, string b) { @@ -68,4 +69,4 @@ namespace Server return a.IndexOf(b) >= 0; } } -} \ No newline at end of file +} diff --git a/Server/Item.cs b/Server/Item.cs index 312ef148c..7698fdfe4 100644 --- a/Server/Item.cs +++ b/Server/Item.cs @@ -1349,25 +1349,14 @@ namespace Server } } + int IComparable.CompareTo(IEntity other) + { + return other == null ? -1 : Serial.CompareTo(other.Serial); + } + public int CompareTo(Item other) { - return CompareTo((IEntity)other); - } - - public int CompareTo(IEntity other) - { - if (other == null) - return -1; - - return Serial.CompareTo(other.Serial); - } - - public int CompareTo(object other) - { - if (other == null || other is IEntity) - return CompareTo((IEntity)other); - - throw new ArgumentException(); + return other == null ? -1 : Serial.CompareTo(other.Serial); } /// diff --git a/Server/Items/Container.cs b/Server/Items/Container.cs index 70cfd39a8..c22cb24e8 100644 --- a/Server/Items/Container.cs +++ b/Server/Items/Container.cs @@ -754,7 +754,7 @@ namespace Server.Items from.SendLocalizedMessage(500446); // That is too far away. } - private class GroupComparer : IComparer + private class GroupComparer : IComparer { private CheckItemGroup m_Grouper; @@ -763,11 +763,8 @@ namespace Server.Items m_Grouper = grouper; } - public int Compare(object x, object y) + public int Compare(Item a, Item b) { - Item a = (Item)x; - Item b = (Item)y; - return m_Grouper(a, b); } } diff --git a/Server/Map.cs b/Server/Map.cs index 5ec47b811..612253fb5 100644 --- a/Server/Map.cs +++ b/Server/Map.cs @@ -275,7 +275,7 @@ namespace Server [Parsable] //[CustomEnum( new string[]{ "Felucca", "Trammel", "Ilshenar", "Malas", "Internal" } )] - public sealed class Map : IComparable, IComparable + public sealed class Map : IComparable { public const int SectorSize = 16; public const int SectorShift = 4; @@ -391,20 +391,9 @@ namespace Server public static int[] InvalidLandTiles{ get; set; } = { 0x244 }; - public int CompareTo(object other) - { - if (other == null || other is Map) - return CompareTo(other); - - throw new ArgumentException(); - } - public int CompareTo(Map other) { - if (other == null) - return -1; - - return MapID.CompareTo(other.MapID); + return other == null ? -1 : MapID.CompareTo(other.MapID); } public static string[] GetMapNames() @@ -428,7 +417,7 @@ namespace Server if (!int.TryParse(value, out int index)) return Maps.FirstOrDefault(m => m != null && Insensitive.Equals(m.Name, value)); - return index == 127 ? Internal : Maps.FirstOrDefault(m => m != null && m.MapIndex == index); + return index == 127 ? Internal : Maps.FirstOrDefault(m => m?.MapIndex == index); } public override string ToString() @@ -967,16 +956,6 @@ namespace Server return p; } - private class ZComparer : IComparer - { - public static readonly ZComparer Default = new ZComparer(); - - public int Compare(Item x, Item y) - { - return x.Z.CompareTo(y.Z); - } - } - public class NullEnumerable : IPooledEnumerable { public static readonly NullEnumerable Instance = new NullEnumerable(); diff --git a/Server/Mobile.cs b/Server/Mobile.cs index 7c29451c7..9cad11436 100644 --- a/Server/Mobile.cs +++ b/Server/Mobile.cs @@ -7694,31 +7694,16 @@ namespace Server } } - #region CompareTo(...) - - public int CompareTo(IEntity other) + int IComparable.CompareTo(IEntity other) { - if (other == null) - return -1; - - return Serial.CompareTo(other.Serial); + return other == null ? -1 : Serial.CompareTo(other.Serial); } public int CompareTo(Mobile other) { - return CompareTo((IEntity)other); + return other == null ? -1 : Serial.CompareTo(other.Serial); } - public int CompareTo(object other) - { - if (other == null || other is IEntity) - return CompareTo((IEntity)other); - - throw new ArgumentException(); - } - - #endregion - #region Handlers public static AllowBeneficialHandler AllowBeneficialHandler{ get; set; } diff --git a/Server/Serial.cs b/Server/Serial.cs index 3ea527f6a..bbf06ed1d 100644 --- a/Server/Serial.cs +++ b/Server/Serial.cs @@ -22,7 +22,7 @@ using System; namespace Server { - public struct Serial : IComparable, IComparable, IComparable + public struct Serial : IComparable, IComparable { public static readonly Serial MinusOne = new Serial(0xFFFFFFFF); public static readonly Serial Zero = new Serial(0); @@ -72,17 +72,12 @@ namespace Server { return Value.GetHashCode(); } - + public int CompareTo(Serial other) { return Value.CompareTo(other.Value); } - public int CompareTo(object obj) - { - return Value.CompareTo(obj); - } - public int CompareTo(uint other) { return Value.CompareTo(other); @@ -148,4 +143,4 @@ namespace Server return new Serial(a); } } -} \ No newline at end of file +}