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


                case "description":
                    paramValues[i] = (System.String)source.Description;
                    break;


                case "equipped_body":
                    paramValues[i] = (System.String)source.EquippedBody;
                    break;


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


                case "height":
                    paramValues[i] = (System.Byte)source.Height;
                    break;


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


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


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


                case "name":
                    paramValues[i] = (System.String)source.Name;
                    break;


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


                case "stat_agi":
                    paramValues[i] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.Agi);
                    break;


                case "stat_defence":
                    paramValues[i] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.Defence);
                    break;


                case "stat_int":
                    paramValues[i] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.Int);
                    break;


                case "stat_maxhit":
                    paramValues[i] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHit);
                    break;


                case "stat_maxhp":
                    paramValues[i] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxHP);
                    break;


                case "stat_maxmp":
                    paramValues[i] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.MaxMP);
                    break;


                case "stat_minhit":
                    paramValues[i] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.MinHit);
                    break;


                case "stat_req_agi":
                    paramValues[i] = (System.Int16)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Agi);
                    break;


                case "stat_req_int":
                    paramValues[i] = (System.Int16)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Int);
                    break;


                case "stat_req_str":
                    paramValues[i] = (System.Int16)source.GetReqStat((DemoGame.StatType)DemoGame.StatType.Str);
                    break;


                case "stat_str":
                    paramValues[i] = (System.Int16)source.GetStat((DemoGame.StatType)DemoGame.StatType.Str);
                    break;


                case "type":
                    paramValues[i] = (System.Byte)source.Type;
                    break;


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


                case "weapon_type":
                    paramValues[i] = (System.Byte)source.WeaponType;
                    break;


                case "width":
                    paramValues[i] = (System.Byte)source.Width;
                    break;
                }
            }
        }
Ejemplo n.º 11
0
 /// <summary>
 /// Copies the values from the given <paramref name="source"/> into this ItemTemplateTable.
 /// </summary>
 /// <param name="source">The IItemTemplateTable to copy the values from.</param>
 public void CopyValuesFrom(IItemTemplateTable source)
 {
     ActionDisplayID = source.ActionDisplayID;
     Description = source.Description;
     EquippedBody = source.EquippedBody;
     Graphic = source.Graphic;
     Height = source.Height;
     HP = source.HP;
     ID = source.ID;
     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;
 }
Ejemplo 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(IItemTemplateTable source, IDictionary<String, Object> dic)
 {
     dic["action_display_id"] = source.ActionDisplayID;
     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["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;
 }