예제 #1
0
        private void HandleIndex(MEffectData data, string key, string value)
        {
            switch (key)
            {
            case ("AbilityCondition"): { this.HandleAbilityCondition(data, key, value); } break;

            case ("CastCondition"): { this.HandleCastCondition(data, key, value); } break;

            case ("Duration"): { data.Duration = int.Parse(value); } break;

            case ("OffensiveResist"): { this.HandleOffensiveResistType(data, key, value); } break;

            case ("SpritesIndexes"): { this.HandleSpriteIndexes(data, value); } break;

            case ("SpritesMax"): { data.SpritesMax = int.Parse(value); } break;

            case ("SpritesMin"): { data.SpritesMin = int.Parse(value); } break;

            case ("SpritesPath"): { data.SpritesPath = value; } break;

            case ("ParticlePath"): { data.ParticlePath = value; } break;

            case ("Resist"): { this.HandleResistType(data, key, value); } break;

            case ("SummonKey"): { data.SummonKey = value; } break;

            case ("WeaponCondition"): { data.WeaponCondition = value; } break;

            case ("X"): { data.X = double.Parse(value); } break;

            case ("Y"): { data.Y = double.Parse(value); } break;

            case ("Z"): { data.Z = double.Parse(value); } break;
            }
        }
예제 #2
0
        public MEffect BuildEffect(MEffectData data, EEffect type)
        {
            var effect = EffectFactory.Instance.CreateNewObject(type);

            effect.SetData(data);
            return(effect);
        }
예제 #3
0
        private void HandleResistType(MEffectData data, string key, string value)
        {
            var type = EResistType.None;

            if (EnumUtil <EResistType> .TryGetEnumValue(value, ref type))
            {
                data.Resist = type;
            }
        }
예제 #4
0
        private void HandleOffensiveResistType(MEffectData data, string key, string value)
        {
            var type = ESecondaryStat.None;

            if (EnumUtil <ESecondaryStat> .TryGetEnumValue(value, ref type))
            {
                data.OffensiveResist = type;
            }
        }
예제 #5
0
        private void HandleCastCondition(MEffectData data, string key, string value)
        {
            var type = ECastType.None;

            if (EnumUtil <ECastType> .TryGetEnumValue(value, ref type))
            {
                data.CastCondition = type;
            }
        }
예제 #6
0
        private void HandleAbilityCondition(MEffectData data, string key, string value)
        {
            var type = EAbility.None;

            if (EnumUtil <EAbility> .TryGetEnumValue(value, ref type))
            {
                data.AbilityCondition = type;
            }
        }
예제 #7
0
        private void HandleSpriteIndexes(MEffectData data, string value)
        {
            var csv = value.Split(',');

            for (int i = 0; i < csv.Length; i++)
            {
                int result = 0;
                if (int.TryParse(csv[i], out result))
                {
                    data.SpriteIndexes.Add(result);
                }
            }
        }
예제 #8
0
        public MEffect BuildEffect(XElement el, EEffect type)
        {
            var data = new MEffectData();

            foreach (var ele in el.Elements())
            {
                this.HandleIndex(data, ele.Name.ToString(), ele.Value);
            }
            var effect = EffectFactory.Instance.CreateNewObject(type);

            effect.SetData(data);
            return(effect);
        }
예제 #9
0
        public virtual MEffectData CloneData()
        {
            var data = new MEffectData();

            data.AbilityCondition = this.Data.AbilityCondition;
            data.CastCondition    = this.Data.CastCondition;
            data.Duration         = this.Data.Duration;
            data.ParticlePath     = this.Data.ParticlePath;
            data.SummonKey        = this.Data.SummonKey;
            data.WeaponCondition  = this.Data.WeaponCondition;
            data.X = this.Data.X;
            data.Y = this.Data.Y;
            data.Z = this.Data.Z;
            return(data);
        }
예제 #10
0
 public void SetData(MEffectData data)
 {
     this._data = data;
 }