Merge https://github.com/ppy/osu into channel-selection

This commit is contained in:
DrabWeb
2017-05-26 03:24:41 -03:00
128 changed files with 5331 additions and 946 deletions

View File

@ -26,6 +26,8 @@ namespace osu.Game.Online.Chat
public Bindable<bool> Joined = new Bindable<bool>();
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));
public bool ReadOnly => Name != "#lazer";

View File

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