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 }
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 }