Example #1
0
 /// <summary>
 /// Initializes the <see cref="TemporaryGuildMember"/>'s values.
 /// </summary>
 /// <param name="values">The values to use.</param>
 public void Initialize(ref TemporaryGuildMemberPoolValues values)
 {
     _name  = values.Name;
     _id    = values.ID;
     _guild = values.Guild;
     _rank  = values.Rank;
 }
Example #2
0
        /// <summary>
        /// When overridden in the derived class, tries to load the guild member with the given <paramref name="name"/>
        /// from an external data source (such as the database). This will only be called when
        /// <see cref="GuildMemberPerformerBase.TryGetGuildMember"/> fails.
        /// </summary>
        /// <param name="name">The name of the <see cref="IGuildMember"/> to get.</param>
        /// <param name="values">When this method returns true, contains the needed loaded values for the
        /// <see cref="IGuildMember"/>.</param>
        /// <returns>True if the <see cref="IGuildMember"/> with the given <paramref name="name"/> was successfully
        /// loaded; otherwise false.</returns>
        protected override bool TryLoadGuildMember(string name, out TemporaryGuildMemberPoolValues values)
        {
            var v = _selectGuildMemberQuery.Execute(name);

            if (v == null)
            {
                values = new TemporaryGuildMemberPoolValues();
                return(false);
            }

            var guild = _guildManager.GetGuild(v.GuildID);

            if (guild == null)
            {
                values = new TemporaryGuildMemberPoolValues();
                return(false);
            }

            values = new TemporaryGuildMemberPoolValues(name, (int)v.CharacterID, guild, v.Rank);
            return(true);
        }
Example #3
0
        /// <summary>
        /// When overridden in the derived class, tries to load the guild member with the given <paramref name="name"/>
        /// from an external data source (such as the database). This will only be called when
        /// <see cref="GuildMemberPerformerBase.TryGetGuildMember"/> fails.
        /// </summary>
        /// <param name="name">The name of the <see cref="IGuildMember"/> to get.</param>
        /// <param name="values">When this method returns true, contains the needed loaded values for the
        /// <see cref="IGuildMember"/>.</param>
        /// <returns>True if the <see cref="IGuildMember"/> with the given <paramref name="name"/> was successfully
        /// loaded; otherwise false.</returns>
        protected override bool TryLoadGuildMember(string name, out TemporaryGuildMemberPoolValues values)
        {
            var v = _selectGuildMemberQuery.Execute(name);
            if (v == null)
            {
                values = new TemporaryGuildMemberPoolValues();
                return false;
            }

            var guild = _guildManager.GetGuild(v.GuildID);
            if (guild == null)
            {
                values = new TemporaryGuildMemberPoolValues();
                return false;
            }

            values = new TemporaryGuildMemberPoolValues(name, (int)v.CharacterID, guild, v.Rank);
            return true;
        }
Example #4
0
 /// <summary>
 /// When overridden in the derived class, tries to load the guild member with the given <paramref name="name"/>
 /// from an external data source (such as the database). This will only be called when
 /// <see cref="GuildMemberPerformerBase.TryGetGuildMember"/> fails.
 /// </summary>
 /// <param name="name">The name of the <see cref="IGuildMember"/> to get.</param>
 /// <param name="values">When this method returns true, contains the needed loaded values for the
 /// <see cref="IGuildMember"/>.</param>
 /// <returns>True if the <see cref="IGuildMember"/> with the given <paramref name="name"/> was successfully
 /// loaded; otherwise false.</returns>
 protected abstract bool TryLoadGuildMember(string name, out TemporaryGuildMemberPoolValues values);