Esempio n. 1
0
            public TData Merge(TData buff, BaseUnit self, BaseUnit caster, TDBaseSkillData fromSkill)
            {
                MaxLayer = buff.MaxLayer > MaxLayer ? buff.MaxLayer : MaxLayer;
                if (MaxLayer <= 0)
                {
                    return(null);
                }
                TData newBuff = null;

                if (BuffList.Count == 0)
                {
                    newBuff = Add(buff, self, caster, fromSkill);
                }
                else
                {
                    newBuff = BuffList[0];
                    if (newBuff.MergeLayer >= MaxLayer)
                    {
                        return(newBuff);
                    }
                    newBuff.OnMerge(buff, caster, fromSkill);
                }
                return(newBuff);
            }
Esempio n. 2
0
            public TData Merge(TData buff, BaseUnit self)
            {
                MaxLayer = buff.MaxLayer > MaxLayer ? buff.MaxLayer : MaxLayer;
                if (MaxLayer <= 0)
                {
                    return(null);
                }
                TData newBuff = null;

                if (Buffs.Count == 0)
                {
                    newBuff = Add(buff, self);
                }
                else
                {
                    newBuff = Buffs[0];
                    if (newBuff.MergeLayer >= MaxLayer)
                    {
                        return(newBuff);
                    }
                    newBuff.OnMerge(buff);
                }
                return(newBuff);
            }