Implemented IComparable<T> on IRole and IGuildUUser
This commit is contained in:
@@ -4,9 +4,7 @@ using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using Model = Discord.API.Role;
|
||||
|
||||
namespace Discord.Rest
|
||||
{
|
||||
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
|
||||
namespace Discord.Rest { [DebuggerDisplay(@"{DebuggerDisplay,nq}")]
|
||||
public class RestRole : RestEntity<ulong>, IRole
|
||||
{
|
||||
public RestGuild Guild { get; }
|
||||
@@ -51,10 +49,12 @@ namespace Discord.Rest
|
||||
public Task DeleteAsync(RequestOptions options = null)
|
||||
=> RoleHelper.DeleteAsync(this, Discord, options);
|
||||
|
||||
|
||||
public override string ToString() => Name;
|
||||
private string DebuggerDisplay => $"{Name} ({Id})";
|
||||
|
||||
//IRole
|
||||
IGuild IRole.Guild => Guild;
|
||||
public int CompareTo(IRole role) => Position.CompareTo(role.Position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,8 @@ namespace Discord.Rest
|
||||
throw new InvalidOperationException("Unable to return this entity's parent unless it was fetched through that object.");
|
||||
}
|
||||
}
|
||||
|
||||
public int CompareTo(IGuildUser user) => this.Compare(user);
|
||||
|
||||
//IVoiceState
|
||||
bool IVoiceState.IsSelfDeafened => false;
|
||||
@@ -103,5 +105,6 @@ namespace Discord.Rest
|
||||
bool IVoiceState.IsSuppressed => false;
|
||||
IVoiceChannel IVoiceState.VoiceChannel => null;
|
||||
string IVoiceState.VoiceSessionId => null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user