Core - Refactored effects

Profile editor - Added effect creation
This commit is contained in:
Robert committed 2022-04-23 17:07:04 +02:00
1 parent e5ba48c7f4
commit 2bf36fbf20
61 files changed
+1005 -763

No files matched your search

@@ -301,7 +301,7 @@ namespace Artemis.Core.Services
public void ReleaseAll()
{
foreach (var (device, keys) in _pressedKeys.ToList())
foreach ((ArtemisDevice? device, HashSet<KeyboardKey>? keys) in _pressedKeys.ToList())
{
foreach (KeyboardKey keyboardKey in keys)
{
@@ -12,7 +12,7 @@ namespace Artemis.Core.Services
/// <see cref="object" /> or <see langword="null" />.
/// <para>Note: Both will be deserialized and serialized respectively using JSON.</para>
/// </summary>
public class DataModelJsonPluginEndPoint<T> : PluginEndPoint where T : DataModel
public class DataModelJsonPluginEndPoint<T> : PluginEndPoint where T : DataModel, new()
{
private readonly Module<T> _module;
@@ -51,7 +51,7 @@ namespace Artemis.Core.Services
/// <param name="module">The module whose datamodel to apply the received JSON to</param>
/// <param name="endPointName">The name of the end point, must be unique</param>
/// <returns>The resulting end point</returns>
DataModelJsonPluginEndPoint<T> AddDataModelJsonEndPoint<T>(Module<T> module, string endPointName) where T : DataModel;
DataModelJsonPluginEndPoint<T> AddDataModelJsonEndPoint<T>(Module<T> module, string endPointName) where T : DataModel, new();
/// <summary>
/// Adds a new endpoint for the given plugin feature receiving an a <see cref="string" />.
@@ -50,7 +50,7 @@ namespace Artemis.Core.Services
.WithModule(PluginsModule);
// Add registered modules
foreach (var webModule in _modules)
foreach (WebModuleRegistration? webModule in _modules)
server = server.WithModule(webModule.CreateInstance());
server = server
@@ -132,7 +132,7 @@ namespace Artemis.Core.Services
return endPoint;
}
public DataModelJsonPluginEndPoint<T> AddDataModelJsonEndPoint<T>(Module<T> module, string endPointName) where T : DataModel
public DataModelJsonPluginEndPoint<T> AddDataModelJsonEndPoint<T>(Module<T> module, string endPointName) where T : DataModel, new()
{
if (module == null) throw new ArgumentNullException(nameof(module));
if (endPointName == null) throw new ArgumentNullException(nameof(endPointName));
@@ -141,7 +141,7 @@ namespace Artemis.Core.Services
return endPoint;
}
private void HandleDataModelRequest<T>(Module<T> module, T value) where T : DataModel
private void HandleDataModelRequest<T>(Module<T> module, T value) where T : DataModel, new()
{
}