/// <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 IQuestRequireFinishItemTable 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;
                }
            }
        }
 /// <summary>
 /// Checks if this <see cref="IQuestRequireFinishItemTable"/> contains the same values as another <see cref="IQuestRequireFinishItemTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IQuestRequireFinishItemTable"/>.</param>
 /// <param name="otherItem">The <see cref="IQuestRequireFinishItemTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IQuestRequireFinishItemTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IQuestRequireFinishItemTable source, IQuestRequireFinishItemTable otherItem)
 {
     return Equals(source.Amount, otherItem.Amount) && Equals(source.ItemTemplateID, otherItem.ItemTemplateID) &&
            Equals(source.QuestID, otherItem.QuestID);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="QuestRequireFinishItemTable"/> class.
 /// </summary>
 /// <param name="source">IQuestRequireFinishItemTable to copy the initial values from.</param>
 public QuestRequireFinishItemTable(IQuestRequireFinishItemTable source)
 {
     CopyValuesFrom(source);
 }
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this QuestRequireFinishItemTable.
 /// </summary>
 /// <param name="source">The IQuestRequireFinishItemTable to copy the values from.</param>
 public void CopyValuesFrom(IQuestRequireFinishItemTable source)
 {
     Amount = source.Amount;
     ItemTemplateID = source.ItemTemplateID;
     QuestID = source.QuestID;
 }
 /// <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(IQuestRequireFinishItemTable source, IDictionary<String, Object> dic)
 {
     dic["amount"] = source.Amount;
     dic["item_template_id"] = source.ItemTemplateID;
     dic["quest_id"] = source.QuestID;
 }
 /// <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 IQuestRequireFinishItemTable source, DbParameterValues paramValues)
 {
     paramValues["amount"]           = source.Amount;
     paramValues["item_template_id"] = (UInt16)source.ItemTemplateID;
     paramValues["quest_id"]         = (UInt16)source.QuestID;
 }
 /// <summary>
 /// Checks if this <see cref="IQuestRequireFinishItemTable"/> contains the same values as another <see cref="IQuestRequireFinishItemTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IQuestRequireFinishItemTable"/>.</param>
 /// <param name="otherItem">The <see cref="IQuestRequireFinishItemTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IQuestRequireFinishItemTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IQuestRequireFinishItemTable source, IQuestRequireFinishItemTable otherItem)
 {
     return(Equals(source.Amount, otherItem.Amount) && Equals(source.ItemTemplateID, otherItem.ItemTemplateID) &&
            Equals(source.QuestID, otherItem.QuestID));
 }
/// <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(IQuestRequireFinishItemTable 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;
}
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this QuestRequireFinishItemTable.
/// </summary>
/// <param name="source">The IQuestRequireFinishItemTable to copy the values from.</param>
public void CopyValuesFrom(IQuestRequireFinishItemTable source)
{
this.Amount = (System.Byte)source.Amount;
this.ItemTemplateID = (DemoGame.ItemTemplateID)source.ItemTemplateID;
this.QuestID = (NetGore.Features.Quests.QuestID)source.QuestID;
}
Exemplo n.º 10
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this QuestRequireFinishItemTable.
/// </summary>
/// <param name="source">The IQuestRequireFinishItemTable to copy the values from.</param>
        public void CopyValuesFrom(IQuestRequireFinishItemTable source)
        {
            this.Amount         = (System.Byte)source.Amount;
            this.ItemTemplateID = (DemoGame.ItemTemplateID)source.ItemTemplateID;
            this.QuestID        = (NetGore.Features.Quests.QuestID)source.QuestID;
        }
Exemplo n.º 11
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(IQuestRequireFinishItemTable 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;
        }
Exemplo n.º 12
0
/// <summary>
/// Initializes a new instance of the <see cref="QuestRequireFinishItemTable"/> class.
/// </summary>
/// <param name="source">IQuestRequireFinishItemTable to copy the initial values from.</param>
        public QuestRequireFinishItemTable(IQuestRequireFinishItemTable source)
        {
            CopyValuesFrom(source);
        }
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this QuestRequireFinishItemTable.
 /// </summary>
 /// <param name="source">The IQuestRequireFinishItemTable to copy the values from.</param>
 public void CopyValuesFrom(IQuestRequireFinishItemTable source)
 {
     Amount         = source.Amount;
     ItemTemplateID = source.ItemTemplateID;
     QuestID        = source.QuestID;
 }
 /// <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(IQuestRequireFinishItemTable source, IDictionary <String, Object> dic)
 {
     dic["amount"]           = source.Amount;
     dic["item_template_id"] = source.ItemTemplateID;
     dic["quest_id"]         = source.QuestID;
 }