Plugins - Separated plugins and implementations as different principles

This commit is contained in:
SpoinkyNL committed 2020-11-09 20:31:54 +01:00
1 parent c0d0e421c7
commit 1e0dc1894d
53 files changed
+438 -410

No files matched your search

@@ -16,7 +16,7 @@ namespace Artemis.Core
{
internal EventPredicateWrapperDataModel()
{
PluginInfo = Constants.CorePluginInfo;
Implementation = Constants.CorePluginInfo;
}
[DataModelIgnore]
@@ -16,7 +16,7 @@ namespace Artemis.Core
{
internal ListPredicateWrapperDataModel()
{
PluginInfo = Constants.CorePluginInfo;
Implementation = Constants.CorePluginInfo;
}
[DataModelIgnore]
@@ -93,7 +93,7 @@ namespace Artemis.Core
/// <summary>
/// Gets the data model GUID of the <see cref="Target" /> if it is a <see cref="DataModel" />
/// </summary>
public Guid? DataModelGuid => Target?.PluginInfo.Guid;
public Guid? DataModelGuid => Target?.Implementation.Guid;
/// <summary>
/// Gets the point-separated path associated with this <see cref="DataModelPath" />
@@ -295,7 +295,7 @@ namespace Artemis.Core
private void DataModelStoreOnDataModelAdded(object? sender, DataModelStoreEvent e)
{
if (e.Registration.DataModel.PluginInfo.Guid != Entity.DataModelGuid)
if (e.Registration.DataModel.Implementation.Guid != Entity.DataModelGuid)
return;
Target = e.Registration.DataModel;
@@ -304,7 +304,7 @@ namespace Artemis.Core
private void DataModelStoreOnDataModelRemoved(object? sender, DataModelStoreEvent e)
{
if (e.Registration.DataModel.PluginInfo.Guid != Entity.DataModelGuid)
if (e.Registration.DataModel.Implementation.Guid != Entity.DataModelGuid)
return;
Target = null;
+1 -1
View File
@@ -662,7 +662,7 @@ namespace Artemis.Core
return;
LayerBrushReference current = General.BrushReference.CurrentValue;
if (e.Registration.Plugin.PluginInfo.Guid == current.BrushPluginGuid &&
if (e.Registration.PluginImplementation.PluginInfo.Guid == current.BrushPluginGuid &&
e.Registration.LayerBrushDescriptor.LayerBrushType.Name == current.BrushType)
ActivateLayerBrush();
}
@@ -254,7 +254,7 @@ namespace Artemis.Core
{
// If effects provided by the plugin are on the element, replace them with placeholders
List<BaseLayerEffect> pluginEffects = _layerEffects.Where(ef => ef.Descriptor.LayerEffectProvider != null &&
ef.PluginInfo.Guid == e.Registration.Plugin.PluginInfo.Guid).ToList();
ef.PluginInfo.Guid == e.Registration.PluginImplementation.PluginInfo.Guid).ToList();
foreach (BaseLayerEffect pluginEffect in pluginEffects)
{
LayerEffectEntity entity = RenderElementEntity.LayerEffects.First(en => en.Id == pluginEffect.EntityId);
@@ -268,7 +268,7 @@ namespace Artemis.Core
private void LayerEffectStoreOnLayerEffectAdded(object sender, LayerEffectStoreEvent e)
{
if (RenderElementEntity.LayerEffects.Any(ef => ef.PluginGuid == e.Registration.Plugin.PluginInfo.Guid))
if (RenderElementEntity.LayerEffects.Any(ef => ef.PluginGuid == e.Registration.PluginImplementation.PluginInfo.Guid))
ActivateEffects();
}
@@ -14,10 +14,10 @@ namespace Artemis.Core
private SKPath _renderPath;
private SKRect _renderRectangle;
internal ArtemisDevice(IRGBDevice rgbDevice, Plugin plugin, ArtemisSurface surface)
internal ArtemisDevice(IRGBDevice rgbDevice, PluginImplementation pluginImplementation, ArtemisSurface surface)
{
RgbDevice = rgbDevice;
Plugin = plugin;
PluginImplementation = pluginImplementation;
Surface = surface;
DeviceEntity = new DeviceEntity();
Leds = rgbDevice.Select(l => new ArtemisLed(l, this)).ToList().AsReadOnly();
@@ -30,10 +30,10 @@ namespace Artemis.Core
CalculateRenderProperties();
}
internal ArtemisDevice(IRGBDevice rgbDevice, Plugin plugin, ArtemisSurface surface, DeviceEntity deviceEntity)
internal ArtemisDevice(IRGBDevice rgbDevice, PluginImplementation pluginImplementation, ArtemisSurface surface, DeviceEntity deviceEntity)
{
RgbDevice = rgbDevice;
Plugin = plugin;
PluginImplementation = pluginImplementation;
Surface = surface;
DeviceEntity = deviceEntity;
Leds = rgbDevice.Select(l => new ArtemisLed(l, this)).ToList().AsReadOnly();
@@ -52,7 +52,7 @@ namespace Artemis.Core
}
public IRGBDevice RgbDevice { get; }
public Plugin Plugin { get; }
public PluginImplementation PluginImplementation { get; }
public ArtemisSurface Surface { get; }
public DeviceEntity DeviceEntity { get; }