Beispiel #1
0
        public virtual T Clone()
        {
            BaseUnitStat <T> stat = new BaseUnitStat <T>();

            stat.icon             = icon;
            stat.customMask       = customMask;
            stat.damageMin        = damageMin;
            stat.damageMax        = damageMax;
            stat.clipSize         = clipSize;
            stat.reloadDuration   = reloadDuration;
            stat.minRange         = minRange;
            stat.attackRange      = attackRange;
            stat.aoeRadius        = aoeRadius;
            stat.hit              = hit;
            stat.dodge            = dodge;
            stat.shieldBreak      = shieldBreak;
            stat.shieldPierce     = shieldPierce;
            stat.damageShieldOnly = damageShieldOnly;
            stat.crit             = crit.Clone();
            stat.stun             = stun.Clone();
            stat.slow             = slow.Clone();
            stat.dot              = dot.Clone();
            stat.instantKill      = instantKill.Clone();
            stat.buff             = buff.Clone();
            stat.buildDuration    = buildDuration;
            stat.unBuildDuration  = unBuildDuration;
            stat.shootObjectT     = shootObjectT;
            stat.desp             = desp;
            stat.rscGain          = new List <int>(rscGain);
            stat.cost             = new List <int>(cost);

            return((T)stat);
        }
Beispiel #2
0
        public UnitStat Clone()
        {
            UnitStat stat = new UnitStat();

            stat.shootObjects     = new List <ShootObject>(shootObjects);
            stat.icon             = icon;
            stat.abilityHolder    = abilityHolder;
            stat.customMask       = customMask;
            stat.damageMin        = damageMin;
            stat.damageMax        = damageMax;
            stat.clipSize         = clipSize;
            stat.reloadDuration   = reloadDuration;
            stat.minRange         = minRange;
            stat.attackRange      = attackRange;
            stat.aoeRadius        = aoeRadius;
            stat.hit              = hit;
            stat.dodge            = dodge;
            stat.shieldBreak      = shieldBreak;
            stat.shieldPierce     = shieldPierce;
            stat.damageShieldOnly = damageShieldOnly;
            stat.crit             = crit.Clone();
            stat.stun             = stun.Clone();
            stat.slow             = slow.Clone();
            stat.dot              = dot.Clone();
            stat.instantKill      = instantKill.Clone();
            stat.buff             = buff.Clone();
            stat.buildDuration    = buildDuration;
            stat.unBuildDuration  = unBuildDuration;
            stat.shootObjectT     = shootObjectT;
            stat.desp             = desp;
            //stat.despGeneral=despGeneral;
            //for(int i=0; i<rscGain.Count; i++) stat.rscGain.Add(rscGain[i]);
            //for(int i=0; i<cost.Count; i++) stat.cost.Add(cost[i]);

            stat.rscGain = new List <int>(rscGain);
            stat.cost    = new List <int>(cost);

            return(stat);
        }