using System;
using System.Collections.Generic;
using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.Core.Plugins.Models;
using Artemis.Core.Services.Interfaces;
using SkiaSharp;
namespace Artemis.Core.Plugins.LayerBrush
{
///
/// A basic layer brush that does not implement any layer property, to use properties with persistent storage,
/// implement instead
///
public abstract class BaseLayerBrush : IDisposable
{
///
/// Gets the layer this brush is applied to
///
public Layer Layer { get; internal set; }
///
/// Gets the descriptor of this brush
///
public LayerBrushDescriptor Descriptor { get; internal set; }
///
/// Gets the plugin info that defined this brush
///
public PluginInfo PluginInfo => Descriptor.LayerBrushProvider.PluginInfo;
internal virtual LayerPropertyGroup BaseProperties => null;
///
/// Called when the brush is being removed from the layer
///
public virtual void Dispose()
{
}
///
/// Called before rendering every frame, write your update logic here
///
///
public virtual void Update(double deltaTime)
{
}
///
/// The main method of rendering anything to the layer. The provided is specific to the layer
/// and matches it's width and height.
/// Called during rendering or layer preview, in the order configured on the layer
///
/// The layer canvas
///
/// The path to be filled, represents the shape
/// The paint to be used to fill the shape
public virtual void Render(SKCanvas canvas, SKImageInfo canvasInfo, SKPath path, SKPaint paint)
{
}
internal virtual void InitializeProperties(ILayerService layerService, string path)
{
}
internal virtual void ApplyToEntity()
{
}
internal virtual void UpdateProperties(double deltaTime)
{
}
internal virtual void OverrideProperties(TimeSpan overrideTime)
{
}
internal virtual IReadOnlyCollection GetAllLayerProperties()
{
return new List();
}
}
}