Пример #1
0
        /// <summary>
        /// Reads the <see cref="GuildInfoMessages.AddMember"/> message.
        /// </summary>
        /// <param name="r">The stream to read the message from.</param>
        void ReadAddMember(IValueReader r)
        {
            var member = r.ReadGuildMemberNameRank(null);

            _members.Add(member);
            _members.Sort();

            OnMemberAdded(member);

            if (MemberAdded != null)
            {
                MemberAdded.Raise(this, EventArgsHelper.Create(member));
            }
        }
Пример #2
0
        /// <summary>
        /// Reads the <see cref="GuildInfoMessages.UpdateRank"/> message.
        /// </summary>
        /// <param name="r">The stream to read the message from.</param>
        void ReadUpdateRank(IValueReader r)
        {
            var member = r.ReadGuildMemberNameRank(null);

            _members.RemoveAll(x => StringComparer.OrdinalIgnoreCase.Equals(x.Name, member.Name));
            _members.Add(member);
            _members.Sort();

            OnMemberRankUpdated(member);

            if (MemberRankUpdated != null)
            {
                MemberRankUpdated.Raise(this, EventArgsHelper.Create(member));
            }
        }
Пример #3
0
        /// <summary>
        /// Reads the <see cref="GuildInfoMessages.UpdateRank"/> message.
        /// </summary>
        /// <param name="r">The stream to read the message from.</param>
        void ReadUpdateRank(IValueReader r)
        {
            var member = r.ReadGuildMemberNameRank(null);
            _members.RemoveAll(x => StringComparer.OrdinalIgnoreCase.Equals(x.Name, member.Name));
            _members.Add(member);
            _members.Sort();

            OnMemberRankUpdated(member);

            if (MemberRankUpdated != null)
                MemberRankUpdated.Raise(this, EventArgsHelper.Create(member));
        }
Пример #4
0
        /// <summary>
        /// Reads the <see cref="GuildInfoMessages.AddMember"/> message.
        /// </summary>
        /// <param name="r">The stream to read the message from.</param>
        void ReadAddMember(IValueReader r)
        {
            var member = r.ReadGuildMemberNameRank(null);
            _members.Add(member);
            _members.Sort();

            OnMemberAdded(member);

            if (MemberAdded != null)
                MemberAdded.Raise(this, EventArgsHelper.Create(member));
        }