Ejemplo n.º 1
0
 /// <summary>
 /// Checks if this <see cref="ICharacterTemplateInventoryTable"/> contains the same values as another <see cref="ICharacterTemplateInventoryTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="ICharacterTemplateInventoryTable"/>.</param>
 /// <param name="otherItem">The <see cref="ICharacterTemplateInventoryTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="ICharacterTemplateInventoryTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this ICharacterTemplateInventoryTable source,
                                     ICharacterTemplateInventoryTable otherItem)
 {
     return(Equals(source.Chance, otherItem.Chance) && Equals(source.CharacterTemplateID, otherItem.CharacterTemplateID) &&
            Equals(source.ID, otherItem.ID) && Equals(source.ItemTemplateID, otherItem.ItemTemplateID) &&
            Equals(source.Max, otherItem.Max) && Equals(source.Min, otherItem.Min));
 }
 /// <summary>
 /// Checks if this <see cref="ICharacterTemplateInventoryTable"/> contains the same values as another <see cref="ICharacterTemplateInventoryTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="ICharacterTemplateInventoryTable"/>.</param>
 /// <param name="otherItem">The <see cref="ICharacterTemplateInventoryTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="ICharacterTemplateInventoryTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this ICharacterTemplateInventoryTable source,
                                     ICharacterTemplateInventoryTable otherItem)
 {
     return Equals(source.Chance, otherItem.Chance) && Equals(source.CharacterTemplateID, otherItem.CharacterTemplateID) &&
            Equals(source.ID, otherItem.ID) && Equals(source.ItemTemplateID, otherItem.ItemTemplateID) &&
            Equals(source.Max, otherItem.Max) && Equals(source.Min, otherItem.Min);
 }
Ejemplo n.º 3
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 ICharacterTemplateInventoryTable source, DbParameterValues paramValues)
        {
            for (var i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "chance":
                    paramValues[i] = (UInt16)source.Chance;
                    break;

                case "character_template_id":
                    paramValues[i] = (UInt16)source.CharacterTemplateID;
                    break;

                case "id":
                    paramValues[i] = source.ID;
                    break;

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

                case "max":
                    paramValues[i] = source.Max;
                    break;

                case "min":
                    paramValues[i] = source.Min;
                    break;
                }
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this CharacterTemplateInventoryTable.
 /// </summary>
 /// <param name="source">The ICharacterTemplateInventoryTable to copy the values from.</param>
 public void CopyValuesFrom(ICharacterTemplateInventoryTable source)
 {
     Chance = source.Chance;
     CharacterTemplateID = source.CharacterTemplateID;
     ID             = source.ID;
     ItemTemplateID = source.ItemTemplateID;
     Max            = source.Max;
     Min            = source.Min;
 }
Ejemplo n.º 5
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(ICharacterTemplateInventoryTable source, IDictionary <String, Object> dic)
 {
     dic["chance"] = source.Chance;
     dic["character_template_id"] = source.CharacterTemplateID;
     dic["id"] = source.ID;
     dic["item_template_id"] = source.ItemTemplateID;
     dic["max"] = source.Max;
     dic["min"] = source.Min;
 }
Ejemplo n.º 6
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this CharacterTemplateInventoryTable.
/// </summary>
/// <param name="source">The ICharacterTemplateInventoryTable to copy the values from.</param>
        public void CopyValuesFrom(ICharacterTemplateInventoryTable source)
        {
            this.Chance = (DemoGame.ItemChance)source.Chance;
            this.CharacterTemplateID = (DemoGame.CharacterTemplateID)source.CharacterTemplateID;
            this.ID             = (System.Int32)source.ID;
            this.ItemTemplateID = (DemoGame.ItemTemplateID)source.ItemTemplateID;
            this.Max            = (System.Byte)source.Max;
            this.Min            = (System.Byte)source.Min;
        }
Ejemplo n.º 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(ICharacterTemplateInventoryTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic)
        {
            dic["chance"] = (DemoGame.ItemChance)source.Chance;
            dic["character_template_id"] = (DemoGame.CharacterTemplateID)source.CharacterTemplateID;
            dic["id"] = (System.Int32)source.ID;
            dic["item_template_id"] = (DemoGame.ItemTemplateID)source.ItemTemplateID;
            dic["max"] = (System.Byte)source.Max;
            dic["min"] = (System.Byte)source.Min;
        }
/// <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 ICharacterTemplateInventoryTable source, NetGore.Db.DbParameterValues paramValues)
        {
            paramValues["chance"] = (System.UInt16)source.Chance;
            paramValues["character_template_id"] = (System.UInt16)source.CharacterTemplateID;
            paramValues["id"] = (System.Int32)source.ID;
            paramValues["item_template_id"] = (System.UInt16)source.ItemTemplateID;
            paramValues["max"] = (System.Byte)source.Max;
            paramValues["min"] = (System.Byte)source.Min;
        }
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this CharacterTemplateInventoryTable.
 /// </summary>
 /// <param name="source">The ICharacterTemplateInventoryTable to copy the values from.</param>
 public void CopyValuesFrom(ICharacterTemplateInventoryTable source)
 {
     Chance = source.Chance;
     CharacterTemplateID = source.CharacterTemplateID;
     ID = source.ID;
     ItemTemplateID = source.ItemTemplateID;
     Max = source.Max;
     Min = source.Min;
 }
 /// <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(ICharacterTemplateInventoryTable source, IDictionary<String, Object> dic)
 {
     dic["chance"] = source.Chance;
     dic["character_template_id"] = source.CharacterTemplateID;
     dic["id"] = source.ID;
     dic["item_template_id"] = source.ItemTemplateID;
     dic["max"] = source.Max;
     dic["min"] = source.Min;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterTemplateInventoryTable"/> class.
 /// </summary>
 /// <param name="source">ICharacterTemplateInventoryTable to copy the initial values from.</param>
 public CharacterTemplateInventoryTable(ICharacterTemplateInventoryTable source)
 {
     CopyValuesFrom(source);
 }
Ejemplo n.º 12
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this CharacterTemplateInventoryTable.
/// </summary>
/// <param name="source">The ICharacterTemplateInventoryTable to copy the values from.</param>
public void CopyValuesFrom(ICharacterTemplateInventoryTable source)
{
this.Chance = (DemoGame.ItemChance)source.Chance;
this.CharacterTemplateID = (DemoGame.CharacterTemplateID)source.CharacterTemplateID;
this.ID = (System.Int32)source.ID;
this.ItemTemplateID = (DemoGame.ItemTemplateID)source.ItemTemplateID;
this.Max = (System.Byte)source.Max;
this.Min = (System.Byte)source.Min;
}
Ejemplo n.º 13
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(ICharacterTemplateInventoryTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic)
{
dic["chance"] = (DemoGame.ItemChance)source.Chance;
dic["character_template_id"] = (DemoGame.CharacterTemplateID)source.CharacterTemplateID;
dic["id"] = (System.Int32)source.ID;
dic["item_template_id"] = (DemoGame.ItemTemplateID)source.ItemTemplateID;
dic["max"] = (System.Byte)source.Max;
dic["min"] = (System.Byte)source.Min;
}
Ejemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CharacterTemplateInventoryTable"/> class.
 /// </summary>
 /// <param name="source">ICharacterTemplateInventoryTable to copy the initial values from.</param>
 public CharacterTemplateInventoryTable(ICharacterTemplateInventoryTable source)
 {
     CopyValuesFrom(source);
 }