Removed seperate plugins project since you're always referencing both..

Added more loading logic
This commit is contained in:
SpoinkyNL committed 2018-04-06 19:54:25 +02:00
1 parent 3db4aab8bc
commit c22a78cd30
57 files changed
+959 -650

No files matched your search

+71
View File
@@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using Artemis.Core.Plugins.Interfaces;
using Artemis.Core.ProfileElements.Interfaces;
using Artemis.Core.Services.Interfaces;
using Artemis.Storage.Entities;
using RGB.NET.Core;
namespace Artemis.Core.ProfileElements
{
public class Layer : IProfileElement
{
public Layer()
{
Children = new List<IProfileElement>();
}
public ILayerType LayerType { get; private set; }
public List<IProfileElement> Children { get; set; }
public int Order { get; set; }
public string Name { get; set; }
public void Update()
{
if (LayerType == null)
return;
lock (LayerType)
{
LayerType.Update(this);
}
}
public void Render(IRGBDevice rgbDevice)
{
if (LayerType == null)
return;
lock (LayerType)
{
LayerType.Render(this, rgbDevice);
}
}
public static Layer FromLayerEntity(LayerEntity layerEntity, IPluginService pluginService)
{
var layer = new Layer
{
Name = layerEntity.Name,
Order = layerEntity.Order,
LayerType = pluginService.GetLayerTypeByGuid(Guid.Parse(layerEntity.Guid))
};
return layer;
}
public void UpdateLayerType(ILayerType layerType)
{
if (LayerType != null)
{
lock (LayerType)
{
LayerType.Dispose();
}
}
LayerType = layerType;
}
}
}