Layer effects - Normalized method naming

This commit is contained in:
SpoinkyNL committed 2020-08-23 23:17:33 +02:00
1 parent e27f658cea
commit 73e992bbb7
13 files changed
+56 -48

No files matched your search

@@ -6,6 +6,7 @@ using System.Linq;
using System.Reflection;
using Artemis.Core.Exceptions;
using Artemis.Core.Plugins.DataModelExpansions.Attributes;
using Artemis.Core.Plugins.DataModelExpansions.Internal;
using Artemis.Core.Plugins.Modules;
namespace Artemis.Core.Plugins.DataModelExpansions
@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Artemis.Core.Plugins.DataModelExpansions.Attributes;
using Artemis.Core.Plugins.DataModelExpansions.Internal;
using Artemis.Core.Utilities;
namespace Artemis.Core.Plugins.DataModelExpansions
@@ -12,7 +9,7 @@ namespace Artemis.Core.Plugins.DataModelExpansions
/// <summary>
/// Allows you to expand the application-wide datamodel
/// </summary>
public abstract class BaseDataModelExpansion<T> : BaseDataModelExpansion where T : DataModel
public abstract class DataModelExpansion<T> : BaseDataModelExpansion where T : DataModel
{
/// <summary>
/// The data model driving this module
@@ -58,31 +55,4 @@ namespace Artemis.Core.Plugins.DataModelExpansions
base.InternalDisablePlugin();
}
}
/// <summary>
/// For internal use only, to implement your own layer property type, extend <see cref="BaseDataModelExpansion{T}" />
/// instead.
/// </summary>
public abstract class BaseDataModelExpansion : Plugin
{
protected readonly List<PropertyInfo> HiddenPropertiesList = new List<PropertyInfo>();
/// <summary>
/// Gets a list of all properties ignored at runtime using IgnoreProperty(x => x.y)
/// </summary>
public ReadOnlyCollection<PropertyInfo> HiddenProperties => HiddenPropertiesList.AsReadOnly();
internal DataModel InternalDataModel { get; set; }
public abstract void Update(double deltaTime);
/// <summary>
/// Override to provide your own data model description. By default this returns a description matching your plugin
/// name and description
/// </summary>
/// <returns></returns>
public virtual DataModelPropertyAttribute GetDataModelDescription()
{
return new DataModelPropertyAttribute {Name = PluginInfo.Name, Description = PluginInfo.Description};
}
}
}
@@ -0,0 +1,34 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Reflection;
using Artemis.Core.Plugins.DataModelExpansions.Attributes;
namespace Artemis.Core.Plugins.DataModelExpansions.Internal
{
/// <summary>
/// For internal use only, to implement your own layer property type, extend <see cref="DataModelExpansion{T}" />
/// instead.
/// </summary>
public abstract class BaseDataModelExpansion : Plugin
{
protected readonly List<PropertyInfo> HiddenPropertiesList = new List<PropertyInfo>();
/// <summary>
/// Gets a list of all properties ignored at runtime using IgnoreProperty(x => x.y)
/// </summary>
public ReadOnlyCollection<PropertyInfo> HiddenProperties => HiddenPropertiesList.AsReadOnly();
internal DataModel InternalDataModel { get; set; }
public abstract void Update(double deltaTime);
/// <summary>
/// Override to provide your own data model description. By default this returns a description matching your plugin
/// name and description
/// </summary>
/// <returns></returns>
public virtual DataModelPropertyAttribute GetDataModelDescription()
{
return new DataModelPropertyAttribute {Name = PluginInfo.Name, Description = PluginInfo.Description};
}
}
}
@@ -22,7 +22,7 @@ namespace Artemis.Core.Plugins.LayerEffects
}
/// <summary>
/// A read-only collection of all layer effects added with <see cref="AddLayerEffectDescriptor{T}" />
/// A read-only collection of all layer effects added with <see cref="RegisterLayerEffectDescriptor{T}" />
/// </summary>
public ReadOnlyCollection<LayerEffectDescriptor> LayerEffectDescriptors => _layerEffectDescriptors.AsReadOnly();
@@ -37,7 +37,7 @@ namespace Artemis.Core.Plugins.LayerEffects
/// The Material icon to display in the UI, a full reference can be found
/// <see href="https://materialdesignicons.com">here</see>
/// </param>
protected void AddLayerEffectDescriptor<T>(string displayName, string description, string icon) where T : BaseLayerEffect
protected void RegisterLayerEffectDescriptor<T>(string displayName, string description, string icon) where T : BaseLayerEffect
{
if (!Enabled)
throw new ArtemisPluginException(PluginInfo, "Can only add a layer effect descriptor when the plugin is enabled");
+1 -1
View File
@@ -28,7 +28,7 @@ namespace Artemis.Core.Plugins.Modules
/// Gets or sets whether this module must also expand the main data model
/// <para>
/// Note: If expanding the main data model is all you want your plugin to do, create a
/// <see cref="BaseDataModelExpansion{T}" /> plugin instead.
/// <see cref="DataModelExpansion{T}" /> plugin instead.
/// </para>
/// </summary>
public bool ExpandsDataModel
@@ -10,6 +10,7 @@ using Artemis.Core.Models.Profile;
using Artemis.Core.Models.Surface;
using Artemis.Core.Plugins.DataModelExpansions;
using Artemis.Core.Plugins.DataModelExpansions.Attributes;
using Artemis.Core.Plugins.DataModelExpansions.Internal;
using Artemis.Core.Utilities;
using SkiaSharp;