SafeAndFree.Data.WeaponStats.GetCopy C# (CSharp) Метод

GetCopy() публичный Метод

public GetCopy ( ) : WeaponStats
Результат WeaponStats
        public WeaponStats GetCopy()
        {
            if (Gift != null)
            {
                return new WeaponStats(Damage, Speed, Splash, Debuff.GetInstance(Gift.Target, Gift.Amount, Gift.Duration));
            }
            else
            {
                return new WeaponStats(Damage, Speed, Splash);
            }
        }

Usage Example

Пример #1
0
        public Projectile(WeaponStats stats, Creep targetCreep, Vector2 startPoint, TowerTypes parentTowerType)
        {
            Stats = stats.GetCopy();
            TargetCreep = targetCreep;

            CenterPosition = startPoint;

            this.type = SelectTypeBasedOnTowerType(parentTowerType);
            this.TextureID =  TowerFactory.GetProjectileMediaID(type);

            this.numFrames = ProjectileDefinitions.ProjectileStats[type].NumFrames;
        }