Пример #1
0
        public static ItemUseEffectInfo Load(DataTableReaderEx reader, out string InxName)
        {
            ItemUseEffectInfo info = new ItemUseEffectInfo();

            InxName = reader.GetString("ItemIndex");

            ItemUseEffectType typeA = (ItemUseEffectType)reader.GetUInt32("UseEffectA");

            if (typeA != ItemUseEffectType.None)
            {
                ItemEffect effect = new ItemEffect();
                effect.Type  = typeA;
                effect.Value = reader.GetUInt32("UseValueA");
                info.Effects.Add(effect);
            }

            ItemUseEffectType typeB = (ItemUseEffectType)reader.GetUInt32("UseEffectB");

            if (typeB != ItemUseEffectType.None)
            {
                ItemEffect effect = new ItemEffect();
                effect.Type  = typeB;
                effect.Value = reader.GetUInt32("UseValueB");
                info.Effects.Add(effect);
            }

            ItemUseEffectType typeC = (ItemUseEffectType)reader.GetUInt32("UseEffectC");

            if (typeC != ItemUseEffectType.None)
            {
                ItemEffect effect = new ItemEffect();
                effect.Type  = typeC;
                effect.Value = reader.GetUInt32("UseValueC");
                info.Effects.Add(effect);
            }
            info.AbState = reader.GetString("UseAbStateName");
            return(info);
        }
Пример #2
0
        public static ItemUseEffectInfo Load(DataRow row, out string inxName)
        {
            ItemUseEffectInfo info = new ItemUseEffectInfo();

            inxName = (string)row["ItemIndex"];

            ItemUseEffectType typeA = (ItemUseEffectType)(uint)row["UseEffectA"];

            if (typeA != ItemUseEffectType.None)
            {
                ItemEffect effect = new ItemEffect();
                effect.Type  = typeA;
                effect.Value = (uint)row["UseValueA"];
                info.Effects.Add(effect);
            }

            ItemUseEffectType typeB = (ItemUseEffectType)(uint)row["UseEffectB"];

            if (typeB != ItemUseEffectType.None)
            {
                ItemEffect effect = new ItemEffect();
                effect.Type  = typeB;
                effect.Value = (uint)row["UseValueB"];
                info.Effects.Add(effect);
            }

            ItemUseEffectType typeC = (ItemUseEffectType)(uint)row["UseEffectC"];

            if (typeC != ItemUseEffectType.None)
            {
                ItemEffect effect = new ItemEffect();
                effect.Type  = typeC;
                effect.Value = (uint)row["UseValueC"];
                info.Effects.Add(effect);
            }
            info.AbState = (string)row["UseAbStateName"];
            return(info);
        }