Replaced several arrays with immutables

This commit is contained in:
RogueException
2016-10-05 23:59:55 -03:00
parent 1b86812741
commit 3c3e790edd
12 changed files with 12 additions and 19 deletions

View File

@@ -15,11 +15,11 @@ namespace Discord.Rest
public IReadOnlyCollection<Overwrite> PermissionOverwrites => _overwrites;
internal IGuild Guild { get; }
public ulong GuildId => Guild.Id;
public string Name { get; private set; }
public int Position { get; private set; }
public ulong GuildId => Guild.Id;
internal RestGuildChannel(BaseDiscordClient discord, IGuild guild, ulong id)
: base(discord, id)
{

View File

@@ -17,7 +17,6 @@ namespace Discord.Rest
public bool IsSyncing { get; private set; }
public ulong ExpireBehavior { get; private set; }
public ulong ExpireGracePeriod { get; private set; }
public ulong GuildId { get; private set; }
public ulong RoleId { get; private set; }
public RestUser User { get; private set; }

View File

@@ -9,7 +9,6 @@ namespace Discord.Rest
{
public string ChannelName { get; private set; }
public string GuildName { get; private set; }
public ulong ChannelId { get; private set; }
public ulong GuildId { get; private set; }

View File

@@ -19,7 +19,6 @@ namespace Discord.Rest
public virtual bool IsPinned => false;
public virtual bool IsWebhook => false;
public virtual DateTimeOffset? EditedTimestamp => null;
public virtual IReadOnlyCollection<IAttachment> Attachments => ImmutableArray.Create<IAttachment>();
public virtual IReadOnlyCollection<IEmbed> Embeds => ImmutableArray.Create<IEmbed>();
public virtual IReadOnlyCollection<ulong> MentionedChannelIds => ImmutableArray.Create<ulong>();

View File

@@ -25,7 +25,6 @@ namespace Discord.Rest
public override bool IsPinned => _isPinned;
public override bool IsWebhook => WebhookId != null;
public override DateTimeOffset? EditedTimestamp => DateTimeUtils.FromTicks(_editedTimestampTicks);
public override IReadOnlyCollection<IAttachment> Attachments => _attachments;
public override IReadOnlyCollection<IEmbed> Embeds => _embeds;
public override IReadOnlyCollection<ulong> MentionedChannelIds => _mentionedChannelIds;

View File

@@ -10,7 +10,6 @@ namespace Discord.Rest
public class RestRole : RestEntity<ulong>, IRole
{
public RestGuild Guild { get; }
public Color Color { get; private set; }
public bool IsHoisted { get; private set; }
public bool IsManaged { get; private set; }

View File

@@ -12,7 +12,6 @@ namespace Discord
public string Type { get; }
public string Name { get; }
public bool IsRevoked { get; }
public IReadOnlyCollection<ulong> IntegrationIds { get; }
internal RestConnection(string id, string type, string name, bool isRevoked, IReadOnlyCollection<ulong> integrationIds)