Core - Added stores for the different register-able types

Profiles - Refactored large parts of the profile structure to use these stores
This commit is contained in:
Robert authored and SpoinkyNL committed 2020-09-09 19:56:06 +02:00
1 parent 4cfe71796c
commit 11de30318e
75 files changed
+1526 -934

No files matched your search

@@ -1,4 +1,5 @@
using System;
using Ninject;
namespace Artemis.Core.LayerBrushes
{
@@ -41,5 +42,28 @@ namespace Artemis.Core.LayerBrushes
/// The plugin that provided this <see cref="LayerBrushDescriptor" />
/// </summary>
public LayerBrushProvider LayerBrushProvider { get; }
/// <summary>
/// Gets or sets the kernel used to instantiate the described layer brush
/// </summary>
internal IKernel Kernel { get; set; }
/// <summary>
/// Creates an instance of the described brush and applies it to the layer
/// </summary>
internal void CreateInstance(Layer layer)
{
if (layer.LayerBrush != null)
throw new ArtemisCoreException("Layer already has an instantiated layer brush");
var brush = (BaseLayerBrush) Kernel.Get(LayerBrushType);
brush.Layer = layer;
brush.Descriptor = this;
brush.Initialize();
brush.Update(0);
layer.LayerBrush = brush;
layer.OnLayerBrushUpdated();
}
}
}