/// <summary> /// Pobiera poziom naladowania danego efektu. /// </summary> /// <param name="type">Typ efektu</param> /// <returns>Poziom naładowania efektu. Zakres: [0 - 1]</returns> public float GetEffectLevel(EffectType type) { switch (type) { case EffectType.BulletTimeEffect: TimeEffect te = _timeEffects.Find(delegate(TimeEffect effect) { return(effect is BulletTimeEffect); }); if (te != null) { return(te.EffectLevel); } break; case EffectType.AltitudeEffect: AltitudeEffect ae = (AltitudeEffect)_otherEffects.Find(delegate(BaseEffect effect) { return(effect is AltitudeEffect); }); if (ae != null) { return(ae.EffectLevel); } break; default: throw new ArgumentException("Niepoprawny argument !", "type"); } return(0.0f); }
/// <summary> /// Rozpoczyna proces zuzywania wybranego efektu. /// </summary> /// <param name="type">Typ efektu</param> public void StartConsumptionEffect(EffectType type) { switch (type) { case EffectType.BulletTimeEffect: TimeEffect te = _timeEffects.Find(delegate(TimeEffect effect) { return(effect is BulletTimeEffect); }); if (te != null) { te.StartConsumption(); } break; } }