/// <summary> /// Checks if this <see cref="IItemTable"/> contains the same values as another <see cref="IItemTable"/>. /// </summary> /// <param name="source">The source <see cref="IItemTable"/>.</param> /// <param name="otherItem">The <see cref="IItemTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IItemTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this IItemTable source, IItemTable otherItem) { return(Equals(source.ActionDisplayID, otherItem.ActionDisplayID) && Equals(source.Amount, otherItem.Amount) && Equals(source.Description, otherItem.Description) && Equals(source.EquippedBody, otherItem.EquippedBody) && Equals(source.Graphic, otherItem.Graphic) && Equals(source.Height, otherItem.Height) && Equals(source.HP, otherItem.HP) && Equals(source.ID, otherItem.ID) && Equals(source.ItemTemplateID, otherItem.ItemTemplateID) && Equals(source.MP, otherItem.MP) && Equals(source.Name, otherItem.Name) && Equals(source.Range, otherItem.Range) && Equals(source.SkillID, otherItem.SkillID) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.Agi), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.Agi)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.Defence), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.Defence)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.Int), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.Int)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHit), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHit)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHP), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHP)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxMP), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.MaxMP)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.MinHit), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.MinHit)) && Equals(source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Agi), otherItem.GetReqStat((DemoGame.StatType)DemoGame.StatType.Agi)) && Equals(source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Int), otherItem.GetReqStat((DemoGame.StatType)DemoGame.StatType.Int)) && Equals(source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Str), otherItem.GetReqStat((DemoGame.StatType)DemoGame.StatType.Str)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.Str), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.Str)) && Equals(source.Type, otherItem.Type) && Equals(source.Value, otherItem.Value) && Equals(source.WeaponType, otherItem.WeaponType) && Equals(source.Width, otherItem.Width)); }
/// <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 IItemTable source, DbParameterValues paramValues) { paramValues["action_display_id"] = (ushort?)source.ActionDisplayID; paramValues["amount"] = source.Amount; paramValues["description"] = source.Description; paramValues["equipped_body"] = source.EquippedBody; paramValues["graphic"] = (UInt16)source.Graphic; paramValues["height"] = source.Height; paramValues["hp"] = (Int16)source.HP; paramValues["id"] = (Int32)source.ID; paramValues["item_template_id"] = (ushort?)source.ItemTemplateID; paramValues["mp"] = (Int16)source.MP; paramValues["name"] = source.Name; paramValues["range"] = source.Range; paramValues["stat_agi"] = (Int16)source.GetStat(StatType.Agi); paramValues["stat_defence"] = (Int16)source.GetStat(StatType.Defence); paramValues["stat_int"] = (Int16)source.GetStat(StatType.Int); paramValues["stat_maxhit"] = (Int16)source.GetStat(StatType.MaxHit); paramValues["stat_maxhp"] = (Int16)source.GetStat(StatType.MaxHP); paramValues["stat_maxmp"] = (Int16)source.GetStat(StatType.MaxMP); paramValues["stat_minhit"] = (Int16)source.GetStat(StatType.MinHit); paramValues["stat_req_agi"] = (Int16)source.GetReqStat(StatType.Agi); paramValues["stat_req_int"] = (Int16)source.GetReqStat(StatType.Int); paramValues["stat_req_str"] = (Int16)source.GetReqStat(StatType.Str); paramValues["stat_str"] = (Int16)source.GetStat(StatType.Str); paramValues["type"] = (Byte)source.Type; paramValues["value"] = source.Value; paramValues["weapon_type"] = (Byte)source.WeaponType; paramValues["width"] = source.Width; }
/// <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(IItemTable source, IDictionary <String, Object> dic) { dic["action_display_id"] = source.ActionDisplayID; dic["amount"] = source.Amount; dic["description"] = source.Description; dic["equipped_body"] = source.EquippedBody; dic["graphic"] = source.Graphic; dic["height"] = source.Height; dic["hp"] = source.HP; dic["id"] = source.ID; dic["item_template_id"] = source.ItemTemplateID; dic["mp"] = source.MP; dic["name"] = source.Name; dic["range"] = source.Range; dic["stat_agi"] = (Int16)source.GetStat(StatType.Agi); dic["stat_defence"] = (Int16)source.GetStat(StatType.Defence); dic["stat_int"] = (Int16)source.GetStat(StatType.Int); dic["stat_maxhit"] = (Int16)source.GetStat(StatType.MaxHit); dic["stat_maxhp"] = (Int16)source.GetStat(StatType.MaxHP); dic["stat_maxmp"] = (Int16)source.GetStat(StatType.MaxMP); dic["stat_minhit"] = (Int16)source.GetStat(StatType.MinHit); dic["stat_req_agi"] = (Int16)source.GetReqStat(StatType.Agi); dic["stat_req_int"] = (Int16)source.GetReqStat(StatType.Int); dic["stat_req_str"] = (Int16)source.GetReqStat(StatType.Str); dic["stat_str"] = (Int16)source.GetStat(StatType.Str); dic["type"] = source.Type; dic["value"] = source.Value; dic["weapon_type"] = source.WeaponType; dic["width"] = source.Width; }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this ItemTable. /// </summary> /// <param name="source">The IItemTable to copy the values from.</param> public void CopyValuesFrom(IItemTable source) { ActionDisplayID = source.ActionDisplayID; Amount = source.Amount; Description = source.Description; EquippedBody = source.EquippedBody; Graphic = source.Graphic; Height = source.Height; HP = source.HP; ID = source.ID; ItemTemplateID = source.ItemTemplateID; MP = source.MP; Name = source.Name; Range = source.Range; SetStat(StatType.Agi, source.GetStat(StatType.Agi)); SetStat(StatType.Defence, source.GetStat(StatType.Defence)); SetStat(StatType.Int, source.GetStat(StatType.Int)); SetStat(StatType.MaxHit, source.GetStat(StatType.MaxHit)); SetStat(StatType.MaxHP, source.GetStat(StatType.MaxHP)); SetStat(StatType.MaxMP, source.GetStat(StatType.MaxMP)); SetStat(StatType.MinHit, source.GetStat(StatType.MinHit)); SetReqStat(StatType.Agi, source.GetReqStat(StatType.Agi)); SetReqStat(StatType.Int, source.GetReqStat(StatType.Int)); SetReqStat(StatType.Str, source.GetReqStat(StatType.Str)); SetStat(StatType.Str, source.GetStat(StatType.Str)); Type = source.Type; Value = source.Value; WeaponType = source.WeaponType; Width = source.Width; }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this ItemTable. /// </summary> /// <param name="source">The IItemTable to copy the values from.</param> public void CopyValuesFrom(IItemTable source) { this.ActionDisplayID = (System.Nullable <NetGore.Features.ActionDisplays.ActionDisplayID>)source.ActionDisplayID; this.Amount = (System.Byte)source.Amount; this.Description = (System.String)source.Description; this.EquippedBody = (System.String)source.EquippedBody; this.Graphic = (NetGore.GrhIndex)source.Graphic; this.Height = (System.Byte)source.Height; this.HP = (DemoGame.SPValueType)source.HP; this.ID = (DemoGame.ItemID)source.ID; this.ItemTemplateID = (System.Nullable <DemoGame.ItemTemplateID>)source.ItemTemplateID; this.MP = (DemoGame.SPValueType)source.MP; this.Name = (System.String)source.Name; this.Range = (System.UInt16)source.Range; this.SetStat((DemoGame.StatType)DemoGame.StatType.Agi, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.Agi)); this.SetStat((DemoGame.StatType)DemoGame.StatType.Defence, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.Defence)); this.SetStat((DemoGame.StatType)DemoGame.StatType.Int, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.Int)); this.SetStat((DemoGame.StatType)DemoGame.StatType.MaxHit, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHit)); this.SetStat((DemoGame.StatType)DemoGame.StatType.MaxHP, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHP)); this.SetStat((DemoGame.StatType)DemoGame.StatType.MaxMP, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxMP)); this.SetStat((DemoGame.StatType)DemoGame.StatType.MinHit, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.MinHit)); this.SetReqStat((DemoGame.StatType)DemoGame.StatType.Agi, (System.Int32)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Agi)); this.SetReqStat((DemoGame.StatType)DemoGame.StatType.Int, (System.Int32)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Int)); this.SetReqStat((DemoGame.StatType)DemoGame.StatType.Str, (System.Int32)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Str)); this.SetStat((DemoGame.StatType)DemoGame.StatType.Str, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.Str)); this.Type = (DemoGame.ItemType)source.Type; this.Value = (System.Int32)source.Value; this.WeaponType = (DemoGame.WeaponType)source.WeaponType; this.Width = (System.Byte)source.Width; }
/// <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(IItemTable source, System.Collections.Generic.IDictionary <System.String, System.Object> dic) { dic["action_display_id"] = (System.Nullable <NetGore.Features.ActionDisplays.ActionDisplayID>)source.ActionDisplayID; dic["amount"] = (System.Byte)source.Amount; dic["description"] = (System.String)source.Description; dic["equipped_body"] = (System.String)source.EquippedBody; dic["graphic"] = (NetGore.GrhIndex)source.Graphic; dic["height"] = (System.Byte)source.Height; dic["hp"] = (DemoGame.SPValueType)source.HP; dic["id"] = (DemoGame.ItemID)source.ID; dic["item_template_id"] = (System.Nullable <DemoGame.ItemTemplateID>)source.ItemTemplateID; dic["mp"] = (DemoGame.SPValueType)source.MP; dic["name"] = (System.String)source.Name; dic["range"] = (System.UInt16)source.Range; dic["stat_agi"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.Agi); dic["stat_defence"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.Defence); dic["stat_int"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.Int); dic["stat_maxhit"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHit); dic["stat_maxhp"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHP); dic["stat_maxmp"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxMP); dic["stat_minhit"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.MinHit); dic["stat_req_agi"] = (System.Int16)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Agi); dic["stat_req_int"] = (System.Int16)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Int); dic["stat_req_str"] = (System.Int16)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Str); dic["stat_str"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.Str); dic["type"] = (DemoGame.ItemType)source.Type; dic["value"] = (System.Int32)source.Value; dic["weapon_type"] = (DemoGame.WeaponType)source.WeaponType; dic["width"] = (System.Byte)source.Width; }
/// <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 IItemTable source, DbParameterValues paramValues) { for (var i = 0; i < paramValues.Count; i++) { switch (paramValues.GetParameterName(i)) { case "action_display_id": paramValues[i] = (ushort?)source.ActionDisplayID; break; case "amount": paramValues[i] = source.Amount; break; case "description": paramValues[i] = source.Description; break; case "equipped_body": paramValues[i] = source.EquippedBody; break; case "graphic": paramValues[i] = (UInt16)source.Graphic; break; case "height": paramValues[i] = source.Height; break; case "hp": paramValues[i] = (Int16)source.HP; break; case "id": paramValues[i] = (Int32)source.ID; break; case "item_template_id": paramValues[i] = (ushort?)source.ItemTemplateID; break; case "mp": paramValues[i] = (Int16)source.MP; break; case "name": paramValues[i] = source.Name; break; case "range": paramValues[i] = source.Range; break; case "stat_agi": paramValues[i] = (Int16)source.GetStat(StatType.Agi); break; case "stat_defence": paramValues[i] = (Int16)source.GetStat(StatType.Defence); break; case "stat_int": paramValues[i] = (Int16)source.GetStat(StatType.Int); break; case "stat_maxhit": paramValues[i] = (Int16)source.GetStat(StatType.MaxHit); break; case "stat_maxhp": paramValues[i] = (Int16)source.GetStat(StatType.MaxHP); break; case "stat_maxmp": paramValues[i] = (Int16)source.GetStat(StatType.MaxMP); break; case "stat_minhit": paramValues[i] = (Int16)source.GetStat(StatType.MinHit); break; case "stat_req_agi": paramValues[i] = (Int16)source.GetReqStat(StatType.Agi); break; case "stat_req_int": paramValues[i] = (Int16)source.GetReqStat(StatType.Int); break; case "stat_req_str": paramValues[i] = (Int16)source.GetReqStat(StatType.Str); break; case "stat_str": paramValues[i] = (Int16)source.GetStat(StatType.Str); break; case "type": paramValues[i] = (Byte)source.Type; break; case "value": paramValues[i] = source.Value; break; case "weapon_type": paramValues[i] = (Byte)source.WeaponType; break; case "width": paramValues[i] = source.Width; break; } } }
/// <summary> /// Checks if this <see cref="IItemTable"/> contains the same values as another <see cref="IItemTable"/>. /// </summary> /// <param name="source">The source <see cref="IItemTable"/>.</param> /// <param name="otherItem">The <see cref="IItemTable"/> to compare the values to.</param> /// <returns> /// True if this <see cref="IItemTable"/> contains the same values as the <paramref name="otherItem"/>; otherwise false. /// </returns> public static System.Boolean HasSameValues(this IItemTable source, IItemTable otherItem) { return Equals(source.ActionDisplayID, otherItem.ActionDisplayID) && Equals(source.Amount, otherItem.Amount) && Equals(source.Description, otherItem.Description) && Equals(source.EquippedBody, otherItem.EquippedBody) && Equals(source.Graphic, otherItem.Graphic) && Equals(source.Height, otherItem.Height) && Equals(source.HP, otherItem.HP) && Equals(source.ID, otherItem.ID) && Equals(source.ItemTemplateID, otherItem.ItemTemplateID) && Equals(source.MP, otherItem.MP) && Equals(source.Name, otherItem.Name) && Equals(source.Range, otherItem.Range) && Equals(source.SkillID, otherItem.SkillID) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.Agi), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.Agi)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.Defence), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.Defence)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.Int), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.Int)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHit), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHit)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHP), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHP)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxMP), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.MaxMP)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.MinHit), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.MinHit)) && Equals(source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Agi), otherItem.GetReqStat((DemoGame.StatType)DemoGame.StatType.Agi)) && Equals(source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Int), otherItem.GetReqStat((DemoGame.StatType)DemoGame.StatType.Int)) && Equals(source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Str), otherItem.GetReqStat((DemoGame.StatType)DemoGame.StatType.Str)) && Equals(source.GetStat((DemoGame.StatType)DemoGame.StatType.Str), otherItem.GetStat((DemoGame.StatType)DemoGame.StatType.Str)) && Equals(source.Type, otherItem.Type) && Equals(source.Value, otherItem.Value) && Equals(source.WeaponType, otherItem.WeaponType) && Equals(source.Width, otherItem.Width); }
/// <summary> /// Copies the values from the given <paramref name="source"/> into this ItemTable. /// </summary> /// <param name="source">The IItemTable to copy the values from.</param> public void CopyValuesFrom(IItemTable source) { this.ActionDisplayID = (System.Nullable<NetGore.Features.ActionDisplays.ActionDisplayID>)source.ActionDisplayID; this.Amount = (System.Byte)source.Amount; this.Description = (System.String)source.Description; this.EquippedBody = (System.String)source.EquippedBody; this.Graphic = (NetGore.GrhIndex)source.Graphic; this.Height = (System.Byte)source.Height; this.HP = (DemoGame.SPValueType)source.HP; this.ID = (DemoGame.ItemID)source.ID; this.ItemTemplateID = (System.Nullable<DemoGame.ItemTemplateID>)source.ItemTemplateID; this.MP = (DemoGame.SPValueType)source.MP; this.Name = (System.String)source.Name; this.Range = (System.UInt16)source.Range; this.SkillID = (System.Nullable<DemoGame.SkillType>)source.SkillID; this.SetStat((DemoGame.StatType)DemoGame.StatType.Agi, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.Agi)); this.SetStat((DemoGame.StatType)DemoGame.StatType.Defence, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.Defence)); this.SetStat((DemoGame.StatType)DemoGame.StatType.Int, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.Int)); this.SetStat((DemoGame.StatType)DemoGame.StatType.MaxHit, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHit)); this.SetStat((DemoGame.StatType)DemoGame.StatType.MaxHP, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHP)); this.SetStat((DemoGame.StatType)DemoGame.StatType.MaxMP, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxMP)); this.SetStat((DemoGame.StatType)DemoGame.StatType.MinHit, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.MinHit)); this.SetReqStat((DemoGame.StatType)DemoGame.StatType.Agi, (System.Int32)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Agi)); this.SetReqStat((DemoGame.StatType)DemoGame.StatType.Int, (System.Int32)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Int)); this.SetReqStat((DemoGame.StatType)DemoGame.StatType.Str, (System.Int32)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Str)); this.SetStat((DemoGame.StatType)DemoGame.StatType.Str, (System.Int32)source.GetStat((DemoGame.StatType)DemoGame.StatType.Str)); this.Type = (DemoGame.ItemType)source.Type; this.Value = (System.Int32)source.Value; this.WeaponType = (DemoGame.WeaponType)source.WeaponType; this.Width = (System.Byte)source.Width; }
/// <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(IItemTable source, System.Collections.Generic.IDictionary<System.String,System.Object> dic) { dic["action_display_id"] = (System.Nullable<NetGore.Features.ActionDisplays.ActionDisplayID>)source.ActionDisplayID; dic["amount"] = (System.Byte)source.Amount; dic["description"] = (System.String)source.Description; dic["equipped_body"] = (System.String)source.EquippedBody; dic["graphic"] = (NetGore.GrhIndex)source.Graphic; dic["height"] = (System.Byte)source.Height; dic["hp"] = (DemoGame.SPValueType)source.HP; dic["id"] = (DemoGame.ItemID)source.ID; dic["item_template_id"] = (System.Nullable<DemoGame.ItemTemplateID>)source.ItemTemplateID; dic["mp"] = (DemoGame.SPValueType)source.MP; dic["name"] = (System.String)source.Name; dic["range"] = (System.UInt16)source.Range; dic["skill_id"] = (System.Nullable<DemoGame.SkillType>)source.SkillID; dic["stat_agi"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.Agi); dic["stat_defence"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.Defence); dic["stat_int"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.Int); dic["stat_maxhit"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHit); dic["stat_maxhp"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHP); dic["stat_maxmp"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxMP); dic["stat_minhit"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.MinHit); dic["stat_req_agi"] = (System.Int16)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Agi); dic["stat_req_int"] = (System.Int16)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Int); dic["stat_req_str"] = (System.Int16)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Str); dic["stat_str"] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.Str); dic["type"] = (DemoGame.ItemType)source.Type; dic["value"] = (System.Int32)source.Value; dic["weapon_type"] = (DemoGame.WeaponType)source.WeaponType; dic["width"] = (System.Byte)source.Width; }
/// <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(IItemTable source, IDictionary<String, Object> dic) { dic["action_display_id"] = source.ActionDisplayID; dic["amount"] = source.Amount; dic["description"] = source.Description; dic["equipped_body"] = source.EquippedBody; dic["graphic"] = source.Graphic; dic["height"] = source.Height; dic["hp"] = source.HP; dic["id"] = source.ID; dic["item_template_id"] = source.ItemTemplateID; dic["mp"] = source.MP; dic["name"] = source.Name; dic["range"] = source.Range; dic["stat_agi"] = (Int16)source.GetStat(StatType.Agi); dic["stat_defence"] = (Int16)source.GetStat(StatType.Defence); dic["stat_int"] = (Int16)source.GetStat(StatType.Int); dic["stat_maxhit"] = (Int16)source.GetStat(StatType.MaxHit); dic["stat_maxhp"] = (Int16)source.GetStat(StatType.MaxHP); dic["stat_maxmp"] = (Int16)source.GetStat(StatType.MaxMP); dic["stat_minhit"] = (Int16)source.GetStat(StatType.MinHit); dic["stat_req_agi"] = (Int16)source.GetReqStat(StatType.Agi); dic["stat_req_int"] = (Int16)source.GetReqStat(StatType.Int); dic["stat_req_str"] = (Int16)source.GetReqStat(StatType.Str); dic["stat_str"] = (Int16)source.GetStat(StatType.Str); dic["type"] = source.Type; dic["value"] = source.Value; dic["weapon_type"] = source.WeaponType; dic["width"] = source.Width; }