Esempio n. 1
0
 public static ParticleSystem GetAttackEffect(TowerType towerType, AttackType attackType)
 {
     try
     {
         var effectData = ContentLoader.Load <ParticleSystemData>(towerType + attackType.ToString() +
                                                                  EffectType.Attack);
         return(new ParticleSystem(effectData));
     }
     catch             //ncrunch: no coverage start, MockContentLoader will have the above lines always pass
     {
         return(FallbackEffects.AttackEffect());
     }             //ncrunch: no coverage end
 }
Esempio n. 2
0
 public static ParticleSystem GetCreepDeathEffect()
 {
     if (deathEffect != null)
     {
         return(deathEffect);
     }
     try
     {
         var effectData = ContentLoader.Load <ParticleSystemData>("Creep" + EffectType.Death);
         return(deathEffect = new ParticleSystem(effectData));
     }
     catch             //ncrunch: no coverage start
     {
         return(deathEffect = FallbackEffects.CreepDeathEffect());
     }             //ncrunch: no coverage end
 }
Esempio n. 3
0
 public static ParticleSystem GetHitEffect(TowerType attackType)
 {
     if (HitEffects[(int)attackType] != null)
     {
         return(HitEffects[(int)attackType]);
     }
     try
     {
         var effectData = ContentLoader.Load <ParticleSystemData>(attackType.ToString() +
                                                                  EffectType.Hit);
         return(HitEffects[(int)attackType] = new ParticleSystem(effectData));
     }
     catch             //ncrunch: no coverage start
     {
         return(HitEffects[(int)attackType] = FallbackEffects.AttackEffect());
     }             //ncrunch: no coverage end
 }
Esempio n. 4
0
 public static ParticleSystem GetProjectileEffect(TowerType towerType, AttackType attackType)
 {
     try
     {
         var effectData = ContentLoader.Load <ParticleSystemData>(towerType + attackType.ToString() +
                                                                  EffectType.Projectile);
         var effect = new ParticleSystem(effectData);
         foreach (var emitter in effect.AttachedEmitters)
         {
             emitter.EmitterData.DoParticlesTrackEmitter = true;
         }
         return(effect);
     }
     catch             //ncrunch: no coverage start
     {
         return(FallbackEffects.ProjectileEffect());
     }             //ncrunch: no coverage end
 }