Data model - Improved encapsulation

Conditions - Renamed from DisplayConditions to DataModelConditions to better match their nature
Core - More documentation
This commit is contained in:
SpoinkyNL committed 2020-09-19 11:43:49 +02:00
1 parent 6b93b1c878
commit a646ff95ed
39 files changed
+581 -355

No files matched your search

@@ -2,13 +2,23 @@
namespace Artemis.Core.LayerBrushes
{
/// <summary>
/// Represents a view model for a brush configuration window
/// </summary>
public abstract class BrushConfigurationViewModel : Screen
{
/// <summary>
/// Creates a new instance of the <see cref="BrushConfigurationViewModel" /> class
/// </summary>
/// <param name="layerBrush"></param>
protected BrushConfigurationViewModel(BaseLayerBrush layerBrush)
{
LayerBrush = layerBrush;
}
/// <summary>
/// Gets the layer brush this view model is associated with
/// </summary>
public BaseLayerBrush LayerBrush { get; }
}
}
@@ -1,10 +1,16 @@
using Artemis.Core.Services;
using SkiaSharp;
using SkiaSharp;
namespace Artemis.Core.LayerBrushes
{
/// <summary>
/// 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
{
/// <summary>
/// Creates a new instance of the <see cref="LayerBrush{T}" /> class
/// </summary>
protected LayerBrush()
{
BrushType = LayerBrushType.Regular;
@@ -44,6 +44,16 @@ namespace Artemis.Core.LayerBrushes
/// </summary>
public LayerBrushProvider LayerBrushProvider { get; }
/// <summary>
/// Determines whether the provided <paramref name="reference" /> references to a brush provided by this descriptor
/// </summary>
public bool MatchesLayerBrushReference(LayerBrushReference reference)
{
if (reference == null)
return false;
return LayerBrushProvider.PluginInfo.Guid == reference.BrushPluginGuid && LayerBrushType.Name == reference.BrushType;
}
/// <summary>
/// Creates an instance of the described brush and applies it to the layer
/// </summary>
@@ -61,12 +71,5 @@ namespace Artemis.Core.LayerBrushes
layer.LayerBrush = brush;
layer.OnLayerBrushUpdated();
}
public bool MatchesLayerBrushReference(LayerBrushReference reference)
{
if (reference == null)
return false;
return LayerBrushProvider.PluginInfo.Guid == reference.BrushPluginGuid && LayerBrushType.Name == reference.BrushType;
}
}
}
@@ -1,16 +1,21 @@
using Artemis.Core.Services;
using SkiaSharp;
using SkiaSharp;
namespace Artemis.Core.LayerBrushes
{
/// <summary>
/// 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
{
/// <summary>
/// Creates a new instance of the <see cref="PerLedLayerBrush{T}" /> class
/// </summary>
protected PerLedLayerBrush()
{
BrushType = LayerBrushType.Regular;
}
/// <summary>
/// The main method of rendering for this type of brush. Called once per frame for each LED in the layer
/// <para>