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

@ -22,7 +22,7 @@ using System;
namespace Server
{
public interface IEntity : IPoint3D, IComparable, IComparable<IEntity>
public interface IEntity : IPoint3D, IComparable<IEntity>
{
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
{
}
}
}
}