/// <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(IViewUserCharacterTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic) { dic["ai_id"] = (System.Nullable <NetGore.AI.AIID>)source.AIID; dic["body_id"] = (DemoGame.BodyID)source.BodyID; dic["cash"] = (System.Int32)source.Cash; dic["character_template_id"] = (System.Nullable <DemoGame.CharacterTemplateID>)source.CharacterTemplateID; dic["chat_dialog"] = (System.Nullable <NetGore.Features.NPCChat.NPCChatDialogID>)source.ChatDialog; dic["exp"] = (System.Int32)source.Exp; dic["hp"] = (DemoGame.SPValueType)source.HP; dic["id"] = (System.Int32)source.ID; dic["level"] = (System.Int16)source.Level; dic["load_map_id"] = (NetGore.World.MapID)source.LoadMapID; dic["load_x"] = (System.UInt16)source.LoadX; dic["load_y"] = (System.UInt16)source.LoadY; dic["move_speed"] = (System.UInt16)source.MoveSpeed; dic["mp"] = (DemoGame.SPValueType)source.MP; dic["name"] = (System.String)source.Name; dic["respawn_map_id"] = (System.Nullable <NetGore.World.MapID>)source.RespawnMapID; dic["respawn_x"] = (System.Single)source.RespawnX; dic["respawn_y"] = (System.Single)source.RespawnY; dic["shop_id"] = (System.Nullable <NetGore.Features.Shops.ShopID>)source.ShopID; dic["statpoints"] = (System.Int32)source.StatPoints; dic["stat_agi"] = (System.Int16)source.StatAgi; dic["stat_defence"] = (System.Int16)source.StatDefence; dic["stat_int"] = (System.Int16)source.StatInt; dic["stat_maxhit"] = (System.Int16)source.StatMaxhit; dic["stat_maxhp"] = (System.Int16)source.StatMaxhp; dic["stat_maxmp"] = (System.Int16)source.StatMaxmp; dic["stat_minhit"] = (System.Int16)source.StatMinhit; dic["stat_str"] = (System.Int16)source.StatStr; }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this ViewUserCharacterTable. /// </summary> /// <param name="source">The IViewUserCharacterTable to copy the values from.</param> public void CopyValuesFrom(IViewUserCharacterTable source) { this.AIID = (System.Nullable <NetGore.AI.AIID>)source.AIID; this.BodyID = (DemoGame.BodyID)source.BodyID; this.Cash = (System.Int32)source.Cash; this.CharacterTemplateID = (System.Nullable <DemoGame.CharacterTemplateID>)source.CharacterTemplateID; this.ChatDialog = (System.Nullable <NetGore.Features.NPCChat.NPCChatDialogID>)source.ChatDialog; this.Exp = (System.Int32)source.Exp; this.HP = (DemoGame.SPValueType)source.HP; this.ID = (System.Int32)source.ID; this.Level = (System.Int16)source.Level; this.LoadMapID = (NetGore.World.MapID)source.LoadMapID; this.LoadX = (System.UInt16)source.LoadX; this.LoadY = (System.UInt16)source.LoadY; this.MoveSpeed = (System.UInt16)source.MoveSpeed; this.MP = (DemoGame.SPValueType)source.MP; this.Name = (System.String)source.Name; this.RespawnMapID = (System.Nullable <NetGore.World.MapID>)source.RespawnMapID; this.RespawnX = (System.Single)source.RespawnX; this.RespawnY = (System.Single)source.RespawnY; this.ShopID = (System.Nullable <NetGore.Features.Shops.ShopID>)source.ShopID; this.StatPoints = (System.Int32)source.StatPoints; this.StatAgi = (System.Int16)source.StatAgi; this.StatDefence = (System.Int16)source.StatDefence; this.StatInt = (System.Int16)source.StatInt; this.StatMaxhit = (System.Int16)source.StatMaxhit; this.StatMaxhp = (System.Int16)source.StatMaxhp; this.StatMaxmp = (System.Int16)source.StatMaxmp; this.StatMinhit = (System.Int16)source.StatMinhit; this.StatStr = (System.Int16)source.StatStr; }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this ViewUserCharacterTable. /// </summary> /// <param name="source">The IViewUserCharacterTable to copy the values from.</param> public void CopyValuesFrom(IViewUserCharacterTable source) { AIID = source.AIID; BodyID = source.BodyID; Cash = source.Cash; CharacterTemplateID = source.CharacterTemplateID; ChatDialog = source.ChatDialog; Exp = source.Exp; HP = source.HP; ID = source.ID; Level = source.Level; LoadMapID = source.LoadMapID; LoadX = source.LoadX; LoadY = source.LoadY; MoveSpeed = source.MoveSpeed; MP = source.MP; Name = source.Name; RespawnMapID = source.RespawnMapID; RespawnX = source.RespawnX; RespawnY = source.RespawnY; ShopID = source.ShopID; StatPoints = source.StatPoints; StatAgi = source.StatAgi; StatDefence = source.StatDefence; StatInt = source.StatInt; StatMaxhit = source.StatMaxhit; StatMaxhp = source.StatMaxhp; StatMaxmp = source.StatMaxmp; StatMinhit = source.StatMinhit; StatStr = source.StatStr; }
/// <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(IViewUserCharacterTable source, IDictionary <String, Object> dic) { dic["ai_id"] = source.AIID; dic["body_id"] = source.BodyID; dic["cash"] = source.Cash; dic["character_template_id"] = source.CharacterTemplateID; dic["chat_dialog"] = source.ChatDialog; dic["exp"] = source.Exp; dic["hp"] = source.HP; dic["id"] = source.ID; dic["level"] = source.Level; dic["load_map_id"] = source.LoadMapID; dic["load_x"] = source.LoadX; dic["load_y"] = source.LoadY; dic["move_speed"] = source.MoveSpeed; dic["mp"] = source.MP; dic["name"] = source.Name; dic["respawn_map_id"] = source.RespawnMapID; dic["respawn_x"] = source.RespawnX; dic["respawn_y"] = source.RespawnY; dic["shop_id"] = source.ShopID; dic["statpoints"] = source.StatPoints; dic["stat_agi"] = source.StatAgi; dic["stat_defence"] = source.StatDefence; dic["stat_int"] = source.StatInt; dic["stat_maxhit"] = source.StatMaxhit; dic["stat_maxhp"] = source.StatMaxhp; dic["stat_maxmp"] = source.StatMaxmp; dic["stat_minhit"] = source.StatMinhit; dic["stat_str"] = source.StatStr; }
/// <summary> /// Checks if this <see cref="IViewUserCharacterTable"/> contains the same values as another <see cref="IViewUserCharacterTable"/>. /// </summary> /// <param name="source">The source <see cref="IViewUserCharacterTable"/>.</param> /// <param name="otherItem">The <see cref="IViewUserCharacterTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IViewUserCharacterTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this IViewUserCharacterTable source, IViewUserCharacterTable otherItem) { return(Equals(source.AIID, otherItem.AIID) && Equals(source.BodyID, otherItem.BodyID) && Equals(source.Cash, otherItem.Cash) && Equals(source.CharacterTemplateID, otherItem.CharacterTemplateID) && Equals(source.ChatDialog, otherItem.ChatDialog) && Equals(source.Exp, otherItem.Exp) && Equals(source.HP, otherItem.HP) && Equals(source.ID, otherItem.ID) && Equals(source.Level, otherItem.Level) && Equals(source.LoadMapID, otherItem.LoadMapID) && Equals(source.LoadX, otherItem.LoadX) && Equals(source.LoadY, otherItem.LoadY) && Equals(source.MoveSpeed, otherItem.MoveSpeed) && Equals(source.MP, otherItem.MP) && Equals(source.Name, otherItem.Name) && Equals(source.RespawnMapID, otherItem.RespawnMapID) && Equals(source.RespawnX, otherItem.RespawnX) && Equals(source.RespawnY, otherItem.RespawnY) && Equals(source.ShopID, otherItem.ShopID) && Equals(source.StatPoints, otherItem.StatPoints) && Equals(source.StatAgi, otherItem.StatAgi) && Equals(source.StatDefence, otherItem.StatDefence) && Equals(source.StatInt, otherItem.StatInt) && Equals(source.StatMaxhit, otherItem.StatMaxhit) && Equals(source.StatMaxhp, otherItem.StatMaxhp) && Equals(source.StatMaxmp, otherItem.StatMaxmp) && Equals(source.StatMinhit, otherItem.StatMinhit) && Equals(source.StatStr, otherItem.StatStr)); }
/// <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 IViewUserCharacterTable source, NetGore.Db.DbParameterValues paramValues) { paramValues["ai_id"] = (System.Nullable <System.UInt16>)source.AIID; paramValues["body_id"] = (System.UInt16)source.BodyID; paramValues["cash"] = (System.Int32)source.Cash; paramValues["character_template_id"] = (System.Nullable <System.UInt16>)source.CharacterTemplateID; paramValues["chat_dialog"] = (System.Nullable <System.UInt16>)source.ChatDialog; paramValues["exp"] = (System.Int32)source.Exp; paramValues["hp"] = (System.Int16)source.HP; paramValues["id"] = (System.Int32)source.ID; paramValues["level"] = (System.Int16)source.Level; paramValues["load_map_id"] = (System.UInt16)source.LoadMapID; paramValues["load_x"] = (System.UInt16)source.LoadX; paramValues["load_y"] = (System.UInt16)source.LoadY; paramValues["move_speed"] = (System.UInt16)source.MoveSpeed; paramValues["mp"] = (System.Int16)source.MP; paramValues["name"] = (System.String)source.Name; paramValues["respawn_map_id"] = (System.Nullable <System.UInt16>)source.RespawnMapID; paramValues["respawn_x"] = (System.Single)source.RespawnX; paramValues["respawn_y"] = (System.Single)source.RespawnY; paramValues["shop_id"] = (System.Nullable <System.UInt16>)source.ShopID; paramValues["statpoints"] = (System.Int32)source.StatPoints; paramValues["stat_agi"] = (System.Int16)source.StatAgi; paramValues["stat_defence"] = (System.Int16)source.StatDefence; paramValues["stat_int"] = (System.Int16)source.StatInt; paramValues["stat_maxhit"] = (System.Int16)source.StatMaxhit; paramValues["stat_maxhp"] = (System.Int16)source.StatMaxhp; paramValues["stat_maxmp"] = (System.Int16)source.StatMaxmp; paramValues["stat_minhit"] = (System.Int16)source.StatMinhit; paramValues["stat_str"] = (System.Int16)source.StatStr; }
/// <summary> /// Checks if this <see cref="IViewUserCharacterTable"/> contains the same values as another <see cref="IViewUserCharacterTable"/>. /// </summary> /// <param name="source">The source <see cref="IViewUserCharacterTable"/>.</param> /// <param name="otherItem">The <see cref="IViewUserCharacterTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IViewUserCharacterTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static Boolean HasSameValues(this IViewUserCharacterTable source, IViewUserCharacterTable otherItem) { return Equals(source.AIID, otherItem.AIID) && Equals(source.BodyID, otherItem.BodyID) && Equals(source.Cash, otherItem.Cash) && Equals(source.CharacterTemplateID, otherItem.CharacterTemplateID) && Equals(source.ChatDialog, otherItem.ChatDialog) && Equals(source.Exp, otherItem.Exp) && Equals(source.HP, otherItem.HP) && Equals(source.ID, otherItem.ID) && Equals(source.Level, otherItem.Level) && Equals(source.LoadMapID, otherItem.LoadMapID) && Equals(source.LoadX, otherItem.LoadX) && Equals(source.LoadY, otherItem.LoadY) && Equals(source.MoveSpeed, otherItem.MoveSpeed) && Equals(source.MP, otherItem.MP) && Equals(source.Name, otherItem.Name) && Equals(source.RespawnMapID, otherItem.RespawnMapID) && Equals(source.RespawnX, otherItem.RespawnX) && Equals(source.RespawnY, otherItem.RespawnY) && Equals(source.ShopID, otherItem.ShopID) && Equals(source.StatPoints, otherItem.StatPoints) && Equals(source.StatAgi, otherItem.StatAgi) && Equals(source.StatDefence, otherItem.StatDefence) && Equals(source.StatInt, otherItem.StatInt) && Equals(source.StatMaxhit, otherItem.StatMaxhit) && Equals(source.StatMaxhp, otherItem.StatMaxhp) && Equals(source.StatMaxmp, otherItem.StatMaxmp) && Equals(source.StatMinhit, otherItem.StatMinhit) && Equals(source.StatStr, otherItem.StatStr); }
/// <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 IViewUserCharacterTable source, DbParameterValues paramValues) { for (var i = 0; i < paramValues.Count; i++) { switch (paramValues.GetParameterName(i)) { case "ai_id": paramValues[i] = (ushort?)source.AIID; break; case "body_id": paramValues[i] = (UInt16)source.BodyID; break; case "cash": paramValues[i] = source.Cash; break; case "character_template_id": paramValues[i] = (ushort?)source.CharacterTemplateID; break; case "chat_dialog": paramValues[i] = (ushort?)source.ChatDialog; break; case "exp": paramValues[i] = source.Exp; break; case "hp": paramValues[i] = (Int16)source.HP; break; case "id": paramValues[i] = source.ID; break; case "level": paramValues[i] = source.Level; break; case "load_map_id": paramValues[i] = (UInt16)source.LoadMapID; break; case "load_x": paramValues[i] = source.LoadX; break; case "load_y": paramValues[i] = source.LoadY; break; case "move_speed": paramValues[i] = source.MoveSpeed; break; case "mp": paramValues[i] = (Int16)source.MP; break; case "name": paramValues[i] = source.Name; break; case "respawn_map_id": paramValues[i] = (ushort?)source.RespawnMapID; break; case "respawn_x": paramValues[i] = source.RespawnX; break; case "respawn_y": paramValues[i] = source.RespawnY; break; case "shop_id": paramValues[i] = (ushort?)source.ShopID; break; case "statpoints": paramValues[i] = source.StatPoints; break; case "stat_agi": paramValues[i] = source.StatAgi; break; case "stat_defence": paramValues[i] = source.StatDefence; break; case "stat_int": paramValues[i] = source.StatInt; break; case "stat_maxhit": paramValues[i] = source.StatMaxhit; break; case "stat_maxhp": paramValues[i] = source.StatMaxhp; break; case "stat_maxmp": paramValues[i] = source.StatMaxmp; break; case "stat_minhit": paramValues[i] = source.StatMinhit; break; case "stat_str": paramValues[i] = source.StatStr; break; } } }
/// <summary> /// Initializes a new instance of the <see cref="ViewUserCharacterTable"/> class. /// </summary> /// <param name="source">IViewUserCharacterTable to copy the initial values from.</param> public ViewUserCharacterTable(IViewUserCharacterTable source) { CopyValuesFrom(source); }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this ViewUserCharacterTable. /// </summary> /// <param name="source">The IViewUserCharacterTable to copy the values from.</param> public void CopyValuesFrom(IViewUserCharacterTable source) { this.AIID = (System.Nullable<NetGore.AI.AIID>)source.AIID; this.BodyID = (DemoGame.BodyID)source.BodyID; this.Cash = (System.Int32)source.Cash; this.CharacterTemplateID = (System.Nullable<DemoGame.CharacterTemplateID>)source.CharacterTemplateID; this.ChatDialog = (System.Nullable<NetGore.Features.NPCChat.NPCChatDialogID>)source.ChatDialog; this.Exp = (System.Int32)source.Exp; this.HP = (DemoGame.SPValueType)source.HP; this.ID = (System.Int32)source.ID; this.Level = (System.Int16)source.Level; this.LoadMapID = (NetGore.World.MapID)source.LoadMapID; this.LoadX = (System.UInt16)source.LoadX; this.LoadY = (System.UInt16)source.LoadY; this.MoveSpeed = (System.UInt16)source.MoveSpeed; this.MP = (DemoGame.SPValueType)source.MP; this.Name = (System.String)source.Name; this.RespawnMapID = (System.Nullable<NetGore.World.MapID>)source.RespawnMapID; this.RespawnX = (System.Single)source.RespawnX; this.RespawnY = (System.Single)source.RespawnY; this.ShopID = (System.Nullable<NetGore.Features.Shops.ShopID>)source.ShopID; this.StatPoints = (System.Int32)source.StatPoints; this.StatAgi = (System.Int16)source.StatAgi; this.StatDefence = (System.Int16)source.StatDefence; this.StatInt = (System.Int16)source.StatInt; this.StatMaxhit = (System.Int16)source.StatMaxhit; this.StatMaxhp = (System.Int16)source.StatMaxhp; this.StatMaxmp = (System.Int16)source.StatMaxmp; this.StatMinhit = (System.Int16)source.StatMinhit; this.StatStr = (System.Int16)source.StatStr; }
/// <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(IViewUserCharacterTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic) { dic["ai_id"] = (System.Nullable<NetGore.AI.AIID>)source.AIID; dic["body_id"] = (DemoGame.BodyID)source.BodyID; dic["cash"] = (System.Int32)source.Cash; dic["character_template_id"] = (System.Nullable<DemoGame.CharacterTemplateID>)source.CharacterTemplateID; dic["chat_dialog"] = (System.Nullable<NetGore.Features.NPCChat.NPCChatDialogID>)source.ChatDialog; dic["exp"] = (System.Int32)source.Exp; dic["hp"] = (DemoGame.SPValueType)source.HP; dic["id"] = (System.Int32)source.ID; dic["level"] = (System.Int16)source.Level; dic["load_map_id"] = (NetGore.World.MapID)source.LoadMapID; dic["load_x"] = (System.UInt16)source.LoadX; dic["load_y"] = (System.UInt16)source.LoadY; dic["move_speed"] = (System.UInt16)source.MoveSpeed; dic["mp"] = (DemoGame.SPValueType)source.MP; dic["name"] = (System.String)source.Name; dic["respawn_map_id"] = (System.Nullable<NetGore.World.MapID>)source.RespawnMapID; dic["respawn_x"] = (System.Single)source.RespawnX; dic["respawn_y"] = (System.Single)source.RespawnY; dic["shop_id"] = (System.Nullable<NetGore.Features.Shops.ShopID>)source.ShopID; dic["statpoints"] = (System.Int32)source.StatPoints; dic["stat_agi"] = (System.Int16)source.StatAgi; dic["stat_defence"] = (System.Int16)source.StatDefence; dic["stat_int"] = (System.Int16)source.StatInt; dic["stat_maxhit"] = (System.Int16)source.StatMaxhit; dic["stat_maxhp"] = (System.Int16)source.StatMaxhp; dic["stat_maxmp"] = (System.Int16)source.StatMaxmp; dic["stat_minhit"] = (System.Int16)source.StatMinhit; dic["stat_str"] = (System.Int16)source.StatStr; }
/// <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(IViewUserCharacterTable source, IDictionary<String, Object> dic) { dic["ai_id"] = source.AIID; dic["body_id"] = source.BodyID; dic["cash"] = source.Cash; dic["character_template_id"] = source.CharacterTemplateID; dic["chat_dialog"] = source.ChatDialog; dic["exp"] = source.Exp; dic["hp"] = source.HP; dic["id"] = source.ID; dic["level"] = source.Level; dic["load_map_id"] = source.LoadMapID; dic["load_x"] = source.LoadX; dic["load_y"] = source.LoadY; dic["move_speed"] = source.MoveSpeed; dic["mp"] = source.MP; dic["name"] = source.Name; dic["respawn_map_id"] = source.RespawnMapID; dic["respawn_x"] = source.RespawnX; dic["respawn_y"] = source.RespawnY; dic["shop_id"] = source.ShopID; dic["statpoints"] = source.StatPoints; dic["stat_agi"] = source.StatAgi; dic["stat_defence"] = source.StatDefence; dic["stat_int"] = source.StatInt; dic["stat_maxhit"] = source.StatMaxhit; dic["stat_maxhp"] = source.StatMaxhp; dic["stat_maxmp"] = source.StatMaxmp; dic["stat_minhit"] = source.StatMinhit; dic["stat_str"] = source.StatStr; }