mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2026-11-10 20:46:24 +00:00
Added missing comments
This commit is contained in:
1 parent
8d32c73b6d
commit
0fc32243c8
12 files changed
+92
-2
No files matched your search
@@ -6,19 +6,34 @@ using System.Linq;
|
||||
|
||||
namespace CUE.NET.Effects
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an generic effect-target.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
public abstract class AbstractEffectTarget<T> : IEffectTarget<T>
|
||||
where T : IEffectTarget<T>
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
|
||||
private IList<EffectTimeContainer> _effectTimes = new List<EffectTimeContainer>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="IEffect{T}" /> attached to this target.
|
||||
/// </summary>
|
||||
protected IList<IEffect<T>> Effects => _effectTimes.Select(x => x.Effect).Cast<IEffect<T>>().ToList();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the strongly-typed target used for the effect.
|
||||
/// </summary>
|
||||
protected abstract T EffectTarget { get; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Updates all effects added to this target.
|
||||
/// </summary>
|
||||
public void UpdateEffects()
|
||||
{
|
||||
lock (Effects)
|
||||
@@ -47,6 +62,10 @@ namespace CUE.NET.Effects
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds an affect.
|
||||
/// </summary>
|
||||
/// <param name="effect">The effect to add.</param>
|
||||
public void AddEffect(IEffect<T> effect)
|
||||
{
|
||||
if (_effectTimes.All(x => x.Effect != effect))
|
||||
@@ -56,6 +75,10 @@ namespace CUE.NET.Effects
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes an effect
|
||||
/// </summary>
|
||||
/// <param name="effect">The effect to remove.</param>
|
||||
public void RemoveEffect(IEffect<T> effect)
|
||||
{
|
||||
EffectTimeContainer effectTimeToRemove = _effectTimes.FirstOrDefault(x => x.Effect == effect);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
// ReSharper disable UnusedAutoPropertyAccessor.Global
|
||||
|
||||
using CUE.NET.Devices.Keyboard.Keys;
|
||||
|
||||
|
||||
Reference in new issue
Block a user