/// <summary>
 /// Checks if this <see cref="IWorldStatsUserShoppingTable"/> contains the same values as another <see cref="IWorldStatsUserShoppingTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IWorldStatsUserShoppingTable"/>.</param>
 /// <param name="otherItem">The <see cref="IWorldStatsUserShoppingTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IWorldStatsUserShoppingTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IWorldStatsUserShoppingTable source, IWorldStatsUserShoppingTable otherItem)
 {
     return(Equals(source.Amount, otherItem.Amount) && Equals(source.CharacterID, otherItem.CharacterID) &&
            Equals(source.Cost, otherItem.Cost) && Equals(source.ID, otherItem.ID) &&
            Equals(source.ItemTemplateID, otherItem.ItemTemplateID) && Equals(source.MapID, otherItem.MapID) &&
            Equals(source.SaleType, otherItem.SaleType) && Equals(source.ShopID, otherItem.ShopID) &&
            Equals(source.When, otherItem.When) && Equals(source.X, otherItem.X) && Equals(source.Y, otherItem.Y));
 }
 /// <summary>
 /// Checks if this <see cref="IWorldStatsUserShoppingTable"/> contains the same values as another <see cref="IWorldStatsUserShoppingTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IWorldStatsUserShoppingTable"/>.</param>
 /// <param name="otherItem">The <see cref="IWorldStatsUserShoppingTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IWorldStatsUserShoppingTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IWorldStatsUserShoppingTable source, IWorldStatsUserShoppingTable otherItem)
 {
     return Equals(source.Amount, otherItem.Amount) && Equals(source.CharacterID, otherItem.CharacterID) &&
            Equals(source.Cost, otherItem.Cost) && Equals(source.ID, otherItem.ID) &&
            Equals(source.ItemTemplateID, otherItem.ItemTemplateID) && Equals(source.MapID, otherItem.MapID) &&
            Equals(source.SaleType, otherItem.SaleType) && Equals(source.ShopID, otherItem.ShopID) &&
            Equals(source.When, otherItem.When) && Equals(source.X, otherItem.X) && Equals(source.Y, otherItem.Y);
 }
        /// <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 IWorldStatsUserShoppingTable source, DbParameterValues paramValues)
        {
            for (var i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "amount":
                    paramValues[i] = source.Amount;
                    break;

                case "character_id":
                    paramValues[i] = (Int32)source.CharacterID;
                    break;

                case "cost":
                    paramValues[i] = source.Cost;
                    break;

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

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

                case "map_id":
                    paramValues[i] = (ushort?)source.MapID;
                    break;

                case "sale_type":
                    paramValues[i] = source.SaleType;
                    break;

                case "shop_id":
                    paramValues[i] = (UInt16)source.ShopID;
                    break;

                case "when":
                    paramValues[i] = source.When;
                    break;

                case "x":
                    paramValues[i] = source.X;
                    break;

                case "y":
                    paramValues[i] = source.Y;
                    break;
                }
            }
        }
Esempio n. 4
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 IWorldStatsUserShoppingTable source, NetGore.Db.DbParameterValues paramValues)
        {
            paramValues["amount"]           = (System.Byte)source.Amount;
            paramValues["character_id"]     = (System.Int32)source.CharacterID;
            paramValues["cost"]             = (System.Int32)source.Cost;
            paramValues["id"]               = (System.UInt32)source.ID;
            paramValues["item_template_id"] = (System.Nullable <System.UInt16>)source.ItemTemplateID;
            paramValues["map_id"]           = (System.Nullable <System.UInt16>)source.MapID;
            paramValues["sale_type"]        = (System.SByte)source.SaleType;
            paramValues["shop_id"]          = (System.UInt16)source.ShopID;
            paramValues["when"]             = (System.DateTime)source.When;
            paramValues["x"] = (System.UInt16)source.X;
            paramValues["y"] = (System.UInt16)source.Y;
        }
Esempio n. 5
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this WorldStatsUserShoppingTable.
 /// </summary>
 /// <param name="source">The IWorldStatsUserShoppingTable to copy the values from.</param>
 public void CopyValuesFrom(IWorldStatsUserShoppingTable source)
 {
     Amount         = source.Amount;
     CharacterID    = source.CharacterID;
     Cost           = source.Cost;
     ID             = source.ID;
     ItemTemplateID = source.ItemTemplateID;
     MapID          = source.MapID;
     SaleType       = source.SaleType;
     ShopID         = source.ShopID;
     When           = source.When;
     X = source.X;
     Y = source.Y;
 }
Esempio n. 6
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(IWorldStatsUserShoppingTable source, IDictionary <String, Object> dic)
 {
     dic["amount"]           = source.Amount;
     dic["character_id"]     = source.CharacterID;
     dic["cost"]             = source.Cost;
     dic["id"]               = source.ID;
     dic["item_template_id"] = source.ItemTemplateID;
     dic["map_id"]           = source.MapID;
     dic["sale_type"]        = source.SaleType;
     dic["shop_id"]          = source.ShopID;
     dic["when"]             = source.When;
     dic["x"] = source.X;
     dic["y"] = source.Y;
 }
 /// <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 IWorldStatsUserShoppingTable source, DbParameterValues paramValues)
 {
     paramValues["amount"]           = source.Amount;
     paramValues["character_id"]     = (Int32)source.CharacterID;
     paramValues["cost"]             = source.Cost;
     paramValues["id"]               = source.ID;
     paramValues["item_template_id"] = (ushort?)source.ItemTemplateID;
     paramValues["map_id"]           = (ushort?)source.MapID;
     paramValues["sale_type"]        = source.SaleType;
     paramValues["shop_id"]          = (UInt16)source.ShopID;
     paramValues["when"]             = source.When;
     paramValues["x"] = source.X;
     paramValues["y"] = source.Y;
 }
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this WorldStatsUserShoppingTable.
/// </summary>
/// <param name="source">The IWorldStatsUserShoppingTable to copy the values from.</param>
        public void CopyValuesFrom(IWorldStatsUserShoppingTable source)
        {
            this.Amount         = (System.Byte)source.Amount;
            this.CharacterID    = (DemoGame.CharacterID)source.CharacterID;
            this.Cost           = (System.Int32)source.Cost;
            this.ID             = (System.UInt32)source.ID;
            this.ItemTemplateID = (System.Nullable <DemoGame.ItemTemplateID>)source.ItemTemplateID;
            this.MapID          = (System.Nullable <NetGore.World.MapID>)source.MapID;
            this.SaleType       = (System.SByte)source.SaleType;
            this.ShopID         = (NetGore.Features.Shops.ShopID)source.ShopID;
            this.When           = (System.DateTime)source.When;
            this.X = (System.UInt16)source.X;
            this.Y = (System.UInt16)source.Y;
        }
/// <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(IWorldStatsUserShoppingTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic)
        {
            dic["amount"]           = (System.Byte)source.Amount;
            dic["character_id"]     = (DemoGame.CharacterID)source.CharacterID;
            dic["cost"]             = (System.Int32)source.Cost;
            dic["id"]               = (System.UInt32)source.ID;
            dic["item_template_id"] = (System.Nullable <DemoGame.ItemTemplateID>)source.ItemTemplateID;
            dic["map_id"]           = (System.Nullable <NetGore.World.MapID>)source.MapID;
            dic["sale_type"]        = (System.SByte)source.SaleType;
            dic["shop_id"]          = (NetGore.Features.Shops.ShopID)source.ShopID;
            dic["when"]             = (System.DateTime)source.When;
            dic["x"] = (System.UInt16)source.X;
            dic["y"] = (System.UInt16)source.Y;
        }
Esempio n. 10
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this WorldStatsUserShoppingTable.
/// </summary>
/// <param name="source">The IWorldStatsUserShoppingTable to copy the values from.</param>
public void CopyValuesFrom(IWorldStatsUserShoppingTable source)
{
this.Amount = (System.Byte)source.Amount;
this.CharacterID = (DemoGame.CharacterID)source.CharacterID;
this.Cost = (System.Int32)source.Cost;
this.ID = (System.UInt32)source.ID;
this.ItemTemplateID = (System.Nullable<DemoGame.ItemTemplateID>)source.ItemTemplateID;
this.MapID = (System.Nullable<NetGore.World.MapID>)source.MapID;
this.SaleType = (System.SByte)source.SaleType;
this.ShopID = (NetGore.Features.Shops.ShopID)source.ShopID;
this.When = (System.DateTime)source.When;
this.X = (System.UInt16)source.X;
this.Y = (System.UInt16)source.Y;
}
Esempio 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(IWorldStatsUserShoppingTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic)
{
dic["amount"] = (System.Byte)source.Amount;
dic["character_id"] = (DemoGame.CharacterID)source.CharacterID;
dic["cost"] = (System.Int32)source.Cost;
dic["id"] = (System.UInt32)source.ID;
dic["item_template_id"] = (System.Nullable<DemoGame.ItemTemplateID>)source.ItemTemplateID;
dic["map_id"] = (System.Nullable<NetGore.World.MapID>)source.MapID;
dic["sale_type"] = (System.SByte)source.SaleType;
dic["shop_id"] = (NetGore.Features.Shops.ShopID)source.ShopID;
dic["when"] = (System.DateTime)source.When;
dic["x"] = (System.UInt16)source.X;
dic["y"] = (System.UInt16)source.Y;
}
Esempio n. 12
0
/// <summary>
/// Initializes a new instance of the <see cref="WorldStatsUserShoppingTable"/> class.
/// </summary>
/// <param name="source">IWorldStatsUserShoppingTable to copy the initial values from.</param>
public WorldStatsUserShoppingTable(IWorldStatsUserShoppingTable source)
{
CopyValuesFrom(source);
}
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this WorldStatsUserShoppingTable.
 /// </summary>
 /// <param name="source">The IWorldStatsUserShoppingTable to copy the values from.</param>
 public void CopyValuesFrom(IWorldStatsUserShoppingTable source)
 {
     Amount = source.Amount;
     CharacterID = source.CharacterID;
     Cost = source.Cost;
     ID = source.ID;
     ItemTemplateID = source.ItemTemplateID;
     MapID = source.MapID;
     SaleType = source.SaleType;
     ShopID = source.ShopID;
     When = source.When;
     X = source.X;
     Y = source.Y;
 }
 /// <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(IWorldStatsUserShoppingTable source, IDictionary<String, Object> dic)
 {
     dic["amount"] = source.Amount;
     dic["character_id"] = source.CharacterID;
     dic["cost"] = source.Cost;
     dic["id"] = source.ID;
     dic["item_template_id"] = source.ItemTemplateID;
     dic["map_id"] = source.MapID;
     dic["sale_type"] = source.SaleType;
     dic["shop_id"] = source.ShopID;
     dic["when"] = source.When;
     dic["x"] = source.X;
     dic["y"] = source.Y;
 }
Esempio n. 15
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 IWorldStatsUserShoppingTable source, NetGore.Db.DbParameterValues paramValues)
        {
            for (int i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "amount":
                    paramValues[i] = (System.Byte)source.Amount;
                    break;


                case "character_id":
                    paramValues[i] = (System.Int32)source.CharacterID;
                    break;


                case "cost":
                    paramValues[i] = (System.Int32)source.Cost;
                    break;


                case "id":
                    paramValues[i] = (System.UInt32)source.ID;
                    break;


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


                case "map_id":
                    paramValues[i] = (System.Nullable <System.UInt16>)source.MapID;
                    break;


                case "sale_type":
                    paramValues[i] = (System.SByte)source.SaleType;
                    break;


                case "shop_id":
                    paramValues[i] = (System.UInt16)source.ShopID;
                    break;


                case "when":
                    paramValues[i] = (System.DateTime)source.When;
                    break;


                case "x":
                    paramValues[i] = (System.UInt16)source.X;
                    break;


                case "y":
                    paramValues[i] = (System.UInt16)source.Y;
                    break;
                }
            }
        }
Esempio n. 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorldStatsUserShoppingTable"/> class.
 /// </summary>
 /// <param name="source">IWorldStatsUserShoppingTable to copy the initial values from.</param>
 public WorldStatsUserShoppingTable(IWorldStatsUserShoppingTable source)
 {
     CopyValuesFrom(source);
 }