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