/// <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 IWorldStatsUserLevelTable source, DbParameterValues paramValues)
 {
     paramValues["character_id"] = (Int32)source.CharacterID;
     paramValues["id"]           = source.ID;
     paramValues["level"]        = source.Level;
     paramValues["map_id"]       = (ushort?)source.MapID;
     paramValues["when"]         = source.When;
     paramValues["x"]            = source.X;
     paramValues["y"]            = source.Y;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this WorldStatsUserLevelTable.
 /// </summary>
 /// <param name="source">The IWorldStatsUserLevelTable to copy the values from.</param>
 public void CopyValuesFrom(IWorldStatsUserLevelTable source)
 {
     CharacterID = source.CharacterID;
     ID          = source.ID;
     Level       = source.Level;
     MapID       = source.MapID;
     When        = source.When;
     X           = source.X;
     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 IWorldStatsUserLevelTable source, NetGore.Db.DbParameterValues paramValues)
        {
            paramValues["character_id"] = (System.Int32)source.CharacterID;
            paramValues["id"]           = (System.UInt32)source.ID;
            paramValues["level"]        = (System.Int16)source.Level;
            paramValues["map_id"]       = (System.Nullable <System.UInt16>)source.MapID;
            paramValues["when"]         = (System.DateTime)source.When;
            paramValues["x"]            = (System.UInt16)source.X;
            paramValues["y"]            = (System.UInt16)source.Y;
        }
Exemplo n.º 4
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(IWorldStatsUserLevelTable source, IDictionary <String, Object> dic)
 {
     dic["character_id"] = source.CharacterID;
     dic["id"]           = source.ID;
     dic["level"]        = source.Level;
     dic["map_id"]       = source.MapID;
     dic["when"]         = source.When;
     dic["x"]            = source.X;
     dic["y"]            = source.Y;
 }
/// <summary>
/// Checks if this <see cref="IWorldStatsUserLevelTable"/> contains the same values as another <see cref="IWorldStatsUserLevelTable"/>.
/// </summary>
/// <param name="source">The source <see cref="IWorldStatsUserLevelTable"/>.</param>
/// <param name="otherItem">The <see cref="IWorldStatsUserLevelTable"/> to compare the values to.</param>
/// <returns>
/// True if this <see cref="IWorldStatsUserLevelTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
/// </returns>
        public static System.Boolean HasSameValues(this IWorldStatsUserLevelTable source, IWorldStatsUserLevelTable otherItem)
        {
            return(Equals(source.CharacterID, otherItem.CharacterID) &&
                   Equals(source.ID, otherItem.ID) &&
                   Equals(source.Level, otherItem.Level) &&
                   Equals(source.MapID, otherItem.MapID) &&
                   Equals(source.When, otherItem.When) &&
                   Equals(source.X, otherItem.X) &&
                   Equals(source.Y, otherItem.Y));
        }
Exemplo n.º 6
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this WorldStatsUserLevelTable.
/// </summary>
/// <param name="source">The IWorldStatsUserLevelTable to copy the values from.</param>
        public void CopyValuesFrom(IWorldStatsUserLevelTable source)
        {
            this.CharacterID = (DemoGame.CharacterID)source.CharacterID;
            this.ID          = (System.UInt32)source.ID;
            this.Level       = (System.Int16)source.Level;
            this.MapID       = (System.Nullable <NetGore.World.MapID>)source.MapID;
            this.When        = (System.DateTime)source.When;
            this.X           = (System.UInt16)source.X;
            this.Y           = (System.UInt16)source.Y;
        }
Exemplo 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(IWorldStatsUserLevelTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic)
        {
            dic["character_id"] = (DemoGame.CharacterID)source.CharacterID;
            dic["id"]           = (System.UInt32)source.ID;
            dic["level"]        = (System.Int16)source.Level;
            dic["map_id"]       = (System.Nullable <NetGore.World.MapID>)source.MapID;
            dic["when"]         = (System.DateTime)source.When;
            dic["x"]            = (System.UInt16)source.X;
            dic["y"]            = (System.UInt16)source.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 IWorldStatsUserLevelTable source, NetGore.Db.DbParameterValues paramValues)
        {
            for (int i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "character_id":
                    paramValues[i] = (System.Int32)source.CharacterID;
                    break;


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


                case "level":
                    paramValues[i] = (System.Int16)source.Level;
                    break;


                case "map_id":
                    paramValues[i] = (System.Nullable <System.UInt16>)source.MapID;
                    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;
                }
            }
        }
        /// <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 IWorldStatsUserLevelTable source, DbParameterValues paramValues)
        {
            for (var i = 0; i < paramValues.Count; i++)
            {
                switch (paramValues.GetParameterName(i))
                {
                case "character_id":
                    paramValues[i] = (Int32)source.CharacterID;
                    break;

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

                case "level":
                    paramValues[i] = source.Level;
                    break;

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

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

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

                case "y":
                    paramValues[i] = source.Y;
                    break;
                }
            }
        }
 /// <summary>
 /// Checks if this <see cref="IWorldStatsUserLevelTable"/> contains the same values as another <see cref="IWorldStatsUserLevelTable"/>.
 /// </summary>
 /// <param name="source">The source <see cref="IWorldStatsUserLevelTable"/>.</param>
 /// <param name="otherItem">The <see cref="IWorldStatsUserLevelTable"/> to compare the values to.</param>
 /// <returns>
 /// True if this <see cref="IWorldStatsUserLevelTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false.
 /// </returns>
 public static Boolean HasSameValues(this IWorldStatsUserLevelTable source, IWorldStatsUserLevelTable otherItem)
 {
     return Equals(source.CharacterID, otherItem.CharacterID) && Equals(source.ID, otherItem.ID) &&
            Equals(source.Level, otherItem.Level) && Equals(source.MapID, otherItem.MapID) &&
            Equals(source.When, otherItem.When) && Equals(source.X, otherItem.X) && Equals(source.Y, otherItem.Y);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this WorldStatsUserLevelTable.
 /// </summary>
 /// <param name="source">The IWorldStatsUserLevelTable to copy the values from.</param>
 public void CopyValuesFrom(IWorldStatsUserLevelTable source)
 {
     CharacterID = source.CharacterID;
     ID = source.ID;
     Level = source.Level;
     MapID = source.MapID;
     When = source.When;
     X = source.X;
     Y = source.Y;
 }
Exemplo n.º 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(IWorldStatsUserLevelTable source, IDictionary<String, Object> dic)
 {
     dic["character_id"] = source.CharacterID;
     dic["id"] = source.ID;
     dic["level"] = source.Level;
     dic["map_id"] = source.MapID;
     dic["when"] = source.When;
     dic["x"] = source.X;
     dic["y"] = source.Y;
 }
Exemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorldStatsUserLevelTable"/> class.
 /// </summary>
 /// <param name="source">IWorldStatsUserLevelTable to copy the initial values from.</param>
 public WorldStatsUserLevelTable(IWorldStatsUserLevelTable source)
 {
     CopyValuesFrom(source);
 }
Exemplo n.º 14
0
/// <summary>
/// Copies the values from the given <paramref name="source"/> into this WorldStatsUserLevelTable.
/// </summary>
/// <param name="source">The IWorldStatsUserLevelTable to copy the values from.</param>
public void CopyValuesFrom(IWorldStatsUserLevelTable source)
{
this.CharacterID = (DemoGame.CharacterID)source.CharacterID;
this.ID = (System.UInt32)source.ID;
this.Level = (System.Int16)source.Level;
this.MapID = (System.Nullable<NetGore.World.MapID>)source.MapID;
this.When = (System.DateTime)source.When;
this.X = (System.UInt16)source.X;
this.Y = (System.UInt16)source.Y;
}
Exemplo n.º 15
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(IWorldStatsUserLevelTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic)
{
dic["character_id"] = (DemoGame.CharacterID)source.CharacterID;
dic["id"] = (System.UInt32)source.ID;
dic["level"] = (System.Int16)source.Level;
dic["map_id"] = (System.Nullable<NetGore.World.MapID>)source.MapID;
dic["when"] = (System.DateTime)source.When;
dic["x"] = (System.UInt16)source.X;
dic["y"] = (System.UInt16)source.Y;
}
Exemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WorldStatsUserLevelTable"/> class.
 /// </summary>
 /// <param name="source">IWorldStatsUserLevelTable to copy the initial values from.</param>
 public WorldStatsUserLevelTable(IWorldStatsUserLevelTable source)
 {
     CopyValuesFrom(source);
 }