Пример #1
0
        internal new static RestGroupUser Create(BaseDiscordClient discord, Model model)
        {
            RestGroupUser entity = new RestGroupUser(discord, model.Id);

            entity.Update(model);
            return(entity);
        }
Пример #2
0
 internal void UpdateUsers(API.UserJson[] models)
 {
     ImmutableDictionary <ulong, RestGroupUser> .Builder users = ImmutableDictionary.CreateBuilder <ulong, RestGroupUser>();
     for (int i = 0; i < models.Length; i++)
     {
         users[models[i].Id] = RestGroupUser.Create(Discord, models[i]);
     }
     _users = users.ToImmutable();
 }
Пример #3
0
 /// <summary>
 /// Converts an existing <see cref="RestGroupUser"/> to an abstracted <see cref="IRestGroupUser"/> value.
 /// </summary>
 /// <param name="restGroupUser">The existing <see cref="RestGroupUser"/> to be abstracted.</param>
 /// <exception cref="ArgumentNullException">Throws for <paramref name="restGroupUser"/>.</exception>
 /// <returns>An <see cref="IRestGroupUser"/> that abstracts <paramref name="restGroupUser"/>.</returns>
 public static IRestGroupUser Abstract(this RestGroupUser restGroupUser)
 => new RestGroupUserAbstraction(restGroupUser);
Пример #4
0
 /// <summary>
 /// Constructs a new <see cref="RestGroupUserAbstraction"/> around an existing <see cref="Rest.RestGroupUser"/>.
 /// </summary>
 /// <param name="restGroupUser">The value to use for <see cref="Rest.RestGroupUser"/>.</param>
 /// <exception cref="ArgumentNullException">Throws for <paramref name="restGroupUser"/>.</exception>
 public RestGroupUserAbstraction(RestGroupUser restGroupUser)
     : base(restGroupUser)
 {
 }