Browse Source

Remove IEquatable implementation for IRole

After a discussion, ends up this was a design choice.
Maybe we can get ContainsId to stay?
pull/181/head
Finite Reality 9 years ago
parent
commit
492cd35fe3
2 changed files with 1 additions and 20 deletions
  1. +1
    -1
      src/Discord.Net/Entities/Roles/IRole.cs
  2. +0
    -19
      src/Discord.Net/Rest/Entities/Roles/Role.cs

+ 1
- 1
src/Discord.Net/Entities/Roles/IRole.cs View File

@@ -5,7 +5,7 @@ using Discord.API.Rest;

namespace Discord
{
public interface IRole : IDeletable, ISnowflakeEntity, IEquatable<IRole>
public interface IRole : IDeletable, ISnowflakeEntity
{
/// <summary> Gets the color given to users of this role. </summary>
Color Color { get; }


+ 0
- 19
src/Discord.Net/Rest/Entities/Roles/Role.cs View File

@@ -57,25 +57,6 @@ namespace Discord
await Discord.ApiClient.DeleteGuildRoleAsync(Guild.Id, Id).ConfigureAwait(false);
}

public override bool Equals(object other)
{
if (other == null) return false;
Role otherAsRole = other as Role;
if (otherAsRole == null) return false;
else return Equals(otherAsRole);
}

public bool Equals(IRole other)
{
if (other == null) return false;
else return (Id.Equals(other.Id));
}

public override int GetHashCode()
{
return Id.GetHashCode();
}

public Role Clone() => MemberwiseClone() as Role;
public override string ToString() => Name;


Loading…
Cancel
Save