From 86c9fb3860fd848fb23f9d6cf6f3946ce19f1ac5 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Thu, 27 Apr 2017 20:50:19 +0200 Subject: [PATCH] Added an effect-list to the effect-target --- Devices/Generic/AbstractCueDevice.cs | 6 ++++++ Effects/AbstractEffectTarget.cs | 2 +- Effects/IEffectTarget.cs | 13 ++++++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Devices/Generic/AbstractCueDevice.cs b/Devices/Generic/AbstractCueDevice.cs index 8ab9b3f..7a253c3 100644 --- a/Devices/Generic/AbstractCueDevice.cs +++ b/Devices/Generic/AbstractCueDevice.cs @@ -345,6 +345,12 @@ namespace CUE.NET.Devices.Generic #region Effects + /// + /// Gets a list of all active effects of this target. + /// For this device this is always null. + /// + public IList> Effects => null; + /// /// NOT IMPLEMENTED: Effects can't be applied directly to the device. Add it to the Brush or create a ledgroup instead. /// diff --git a/Effects/AbstractEffectTarget.cs b/Effects/AbstractEffectTarget.cs index bee181b..6f3e3b2 100644 --- a/Effects/AbstractEffectTarget.cs +++ b/Effects/AbstractEffectTarget.cs @@ -24,7 +24,7 @@ namespace CUE.NET.Effects /// /// Gets all attached to this target. /// - protected IList> Effects => EffectTimes.Select(x => x.Effect).Cast>().ToList(); + public IList> Effects => EffectTimes.Select(x => x.Effect).Cast>().ToList(); /// /// Gets the strongly-typed target used for the effect. diff --git a/Effects/IEffectTarget.cs b/Effects/IEffectTarget.cs index 119ce46..3a801ba 100644 --- a/Effects/IEffectTarget.cs +++ b/Effects/IEffectTarget.cs @@ -1,14 +1,25 @@ // ReSharper disable UnusedMember.Global +using System.Collections.Generic; + namespace CUE.NET.Effects { /// /// Represents a basic effect-target. /// /// The type this target represents. - public interface IEffectTarget + public interface IEffectTarget where T : IEffectTarget { + #region Properties & Fields + + /// + /// Gets a list of all active effects of this target. + /// + IList> Effects { get; } + + #endregion + #region Methods ///