Revert "Use generic IComparable for message."

This reverts commit aaaee5ed10.
This commit is contained in:
Dean Herbert 2017-05-17 13:44:43 +09:00
parent c78f4cc7ab
commit 78c1d4581f
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
2 changed files with 13 additions and 3 deletions

View File

@ -23,7 +23,7 @@ public class Channel
[JsonProperty(@"channel_id")]
public int Id;
public readonly SortedList<Message> Messages = new SortedList<Message>(Comparer<Message>.Default);
public readonly SortedList<Message> Messages = new SortedList<Message>((m1, m2) => m1.Id.CompareTo(m2.Id));
//internal bool Joined;

View File

@ -8,7 +8,7 @@
namespace osu.Game.Online.Chat
{
public class Message : IComparable<Message>
public class Message
{
[JsonProperty(@"message_id")]
public readonly long Id;
@ -42,7 +42,17 @@ public Message(long id)
Id = id;
}
public int CompareTo(Message other) => Id.CompareTo(other.Id);
public override bool Equals(object obj)
{
var objMessage = obj as Message;
return Id == objMessage?.Id;
}
public override int GetHashCode()
{
return Id.GetHashCode();
}
}
public enum TargetType