Core - Refactored effects

Profile editor - Added effect creation
This commit is contained in:
Robert committed 2022-04-23 17:07:04 +02:00
1 parent e5ba48c7f4
commit 2bf36fbf20
61 files changed
+1005 -763

No files matched your search

@@ -6,7 +6,7 @@ namespace Artemis.Core.LayerBrushes
/// <summary>
/// For internal use only, please use <see cref="LayerBrush{T}" /> or <see cref="PerLedLayerBrush{T}" /> or instead
/// </summary>
public abstract class PropertiesLayerBrush<T> : BaseLayerBrush where T : LayerPropertyGroup
public abstract class PropertiesLayerBrush<T> : BaseLayerBrush where T : LayerPropertyGroup, new()
{
private T _properties = null!;
@@ -35,7 +35,7 @@ namespace Artemis.Core.LayerBrushes
internal void InitializeProperties(PropertyGroupEntity? propertyGroupEntity)
{
Properties = Activator.CreateInstance<T>();
Properties = new T();
PropertyGroupDescriptionAttribute groupDescription = new() {Identifier = "Brush", Name = Descriptor.DisplayName, Description = Descriptor.Description};
Properties.Initialize(Layer, null, groupDescription, propertyGroupEntity);
PropertiesInitialized = true;
@@ -6,7 +6,7 @@ namespace Artemis.Core.LayerBrushes
/// Represents a brush that renders on a layer
/// </summary>
/// <typeparam name="T">The type of brush properties</typeparam>
public abstract class LayerBrush<T> : PropertiesLayerBrush<T> where T : LayerPropertyGroup
public abstract class LayerBrush<T> : PropertiesLayerBrush<T> where T : LayerPropertyGroup, new()
{
/// <summary>
/// Creates a new instance of the <see cref="LayerBrush{T}" /> class
@@ -69,8 +69,6 @@ namespace Artemis.Core.LayerBrushes
brush.LayerBrushEntity = entity ?? new LayerBrushEntity { ProviderId = Provider.Id, BrushType = LayerBrushType.FullName };
brush.Initialize();
brush.Update(0);
return brush;
}
}
@@ -6,7 +6,7 @@ namespace Artemis.Core.LayerBrushes
/// Represents a brush that renders on a per-layer basis
/// </summary>
/// <typeparam name="T">The type of brush properties</typeparam>
public abstract class PerLedLayerBrush<T> : PropertiesLayerBrush<T> where T : LayerPropertyGroup
public abstract class PerLedLayerBrush<T> : PropertiesLayerBrush<T> where T : LayerPropertyGroup, new()
{
/// <summary>
/// Creates a new instance of the <see cref="PerLedLayerBrush{T}" /> class