コード例 #1
0
        /// <summary>
        /// Copies the column values into the given DbParameterValues using the database column name
        /// with a prefixed @ as the key. The key must already exist in the DbParameterValues
        /// for the value to be copied over. If any of the keys in the DbParameterValues do not
        /// match one of the column names, or if there is no field for a key, then it will be
        /// ignored. Because of this, it is important to be careful when using this method
        /// since columns or keys can be skipped without any indication.
        /// </summary>
        /// <param name="source">The object to copy the values from.</param>
        /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
        public static void TryCopyValues(this IQuestRequireStartItemTable source, DbParameterValues paramValues)
        {
            for (var i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "amount":
                    paramValues[i] = source.Amount;
                    break;

                case "item_template_id":
                    paramValues[i] = (UInt16)source.ItemTemplateID;
                    break;

                case "quest_id":
                    paramValues[i] = (UInt16)source.QuestID;
                    break;
                }
            }
        }
コード例 #2
0
/// <summary>
/// Checks if this <see cref="IQuestRequireStartItemTable"/> contains the same values as another <see cref="IQuestRequireStartItemTable"/>.
/// </summary>
/// <param name="source">The source <see cref="IQuestRequireStartItemTable"/>.</param>
/// <param name="otherItem">The <see cref="IQuestRequireStartItemTable"/> to compare the values to.</param>
/// <returns>
/// True if this <see cref="IQuestRequireStartItemTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
/// </returns>
public static System.Boolean HasSameValues(this IQuestRequireStartItemTable source, IQuestRequireStartItemTable otherItem)
{
return Equals(source.Amount, otherItem.Amount) && 
Equals(source.ItemTemplateID, otherItem.ItemTemplateID) && 
Equals(source.QuestID, otherItem.QuestID);
}
コード例 #3
0
 /// <summary>
 /// Checks if this <see cref="IQuestRequireStartItemTable"/> contains the same values as another <see cref="IQuestRequireStartItemTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IQuestRequireStartItemTable"/>.</param>
 /// <param name="otherItem">The <see cref="IQuestRequireStartItemTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IQuestRequireStartItemTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IQuestRequireStartItemTable source, IQuestRequireStartItemTable otherItem)
 {
     return(Equals(source.Amount, otherItem.Amount) && Equals(source.ItemTemplateID, otherItem.ItemTemplateID) &&
            Equals(source.QuestID, otherItem.QuestID));
 }
コード例 #4
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this QuestRequireStartItemTable.
/// </summary>
/// <param name="source">The IQuestRequireStartItemTable to copy the values from.</param>
        public void CopyValuesFrom(IQuestRequireStartItemTable source)
        {
            this.Amount         = (System.Byte)source.Amount;
            this.ItemTemplateID = (DemoGame.ItemTemplateID)source.ItemTemplateID;
            this.QuestID        = (NetGore.Features.Quests.QuestID)source.QuestID;
        }
コード例 #5
0
 /// <summary>
 /// Copies the column values into the given DbParameterValues using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the DbParameterValues;
 ///  this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="paramValues">The DbParameterValues to copy the values into.</param>
 public static void CopyValues(this IQuestRequireStartItemTable source, DbParameterValues paramValues)
 {
     paramValues["amount"]           = source.Amount;
     paramValues["item_template_id"] = (UInt16)source.ItemTemplateID;
     paramValues["quest_id"]         = (UInt16)source.QuestID;
 }
コード例 #6
0
/// <summary>
/// Initializes a new instance of the <see cref="QuestRequireStartItemTable"/> class.
/// </summary>
/// <param name="source">IQuestRequireStartItemTable to copy the initial values from.</param>
        public QuestRequireStartItemTable(IQuestRequireStartItemTable source)
        {
            CopyValuesFrom(source);
        }
コード例 #7
0
/// <summary>
/// Copies the column values into the given Dictionary using the database column name
/// with a prefixed @ as the key. The keys must already exist in the Dictionary;
/// this method will not create them if they are missing.
/// </summary>
/// <param name="source">The object to copy the values from.</param>
/// <param name="dic">The Dictionary to copy the values into.</param>
        public static void CopyValues(IQuestRequireStartItemTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic)
        {
            dic["amount"]           = (System.Byte)source.Amount;
            dic["item_template_id"] = (DemoGame.ItemTemplateID)source.ItemTemplateID;
            dic["quest_id"]         = (NetGore.Features.Quests.QuestID)source.QuestID;
        }
コード例 #8
0
 /// <summary>
 /// Copies the column values into the given Dictionary using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the Dictionary;
 /// this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="dic">The Dictionary to copy the values into.</param>
 public static void CopyValues(IQuestRequireStartItemTable source, IDictionary <String, Object> dic)
 {
     dic["amount"]           = source.Amount;
     dic["item_template_id"] = source.ItemTemplateID;
     dic["quest_id"]         = source.QuestID;
 }
コード例 #9
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this QuestRequireStartItemTable.
 /// </summary>
 /// <param name="source">The IQuestRequireStartItemTable to copy the values from.</param>
 public void CopyValuesFrom(IQuestRequireStartItemTable source)
 {
     Amount         = source.Amount;
     ItemTemplateID = source.ItemTemplateID;
     QuestID        = source.QuestID;
 }
コード例 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="QuestRequireStartItemTable"/> class.
 /// </summary>
 /// <param name="source">IQuestRequireStartItemTable to copy the initial values from.</param>
 public QuestRequireStartItemTable(IQuestRequireStartItemTable source)
 {
     CopyValuesFrom(source);
 }
コード例 #11
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this QuestRequireStartItemTable.
 /// </summary>
 /// <param name="source">The IQuestRequireStartItemTable to copy the values from.</param>
 public void CopyValuesFrom(IQuestRequireStartItemTable source)
 {
     Amount = source.Amount;
     ItemTemplateID = source.ItemTemplateID;
     QuestID = source.QuestID;
 }
コード例 #12
0
 /// <summary>
 /// Copies the column values into the given Dictionary using the database column name
 /// with a prefixed @ as the key. The keys must already exist in the Dictionary;
 /// this method will not create them if they are missing.
 /// </summary>
 /// <param name="source">The object to copy the values from.</param>
 /// <param name="dic">The Dictionary to copy the values into.</param>
 public static void CopyValues(IQuestRequireStartItemTable source, IDictionary<String, Object> dic)
 {
     dic["amount"] = source.Amount;
     dic["item_template_id"] = source.ItemTemplateID;
     dic["quest_id"] = source.QuestID;
 }
コード例 #13
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this QuestRequireStartItemTable.
/// </summary>
/// <param name="source">The IQuestRequireStartItemTable to copy the values from.</param>
public void CopyValuesFrom(IQuestRequireStartItemTable source)
{
this.Amount = (System.Byte)source.Amount;
this.ItemTemplateID = (DemoGame.ItemTemplateID)source.ItemTemplateID;
this.QuestID = (NetGore.Features.Quests.QuestID)source.QuestID;
}
コード例 #14
0
/// <summary>
/// Copies the column values into the given Dictionary using the database column name
/// with a prefixed @ as the key. The keys must already exist in the Dictionary;
/// this method will not create them if they are missing.
/// </summary>
/// <param name="source">The object to copy the values from.</param>
/// <param name="dic">The Dictionary to copy the values into.</param>
public static void CopyValues(IQuestRequireStartItemTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic)
{
dic["amount"] = (System.Byte)source.Amount;
dic["item_template_id"] = (DemoGame.ItemTemplateID)source.ItemTemplateID;
dic["quest_id"] = (NetGore.Features.Quests.QuestID)source.QuestID;
}