some background code for manager workspaces
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using ModpackUpdater.Apps.Manager.Api.Model;
|
||||
using Pilz.Plugins.Advanced;
|
||||
|
||||
namespace ModpackUpdater.Apps.Manager.Api.Plugins.Features;
|
||||
|
||||
public abstract class WorkspaceFeature(string identifier, string name) : PluginFeature(FeatureTypes.Workspace, identifier, name)
|
||||
{
|
||||
public virtual bool CanConfigure(IWorkspace workspace)
|
||||
{
|
||||
return workspace?.Config == null || workspace.Config.ProviderId == Identifier;
|
||||
}
|
||||
|
||||
public virtual bool Configure(ref IWorkspace workspace)
|
||||
{
|
||||
OnConfigure(ref workspace);
|
||||
|
||||
if (workspace?.Config == null)
|
||||
return false;
|
||||
|
||||
workspace.Config.ProviderId = Identifier;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected abstract bool OnConfigure(ref IWorkspace workspace);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using ModpackUpdater.Apps.Manager.Api.Model;
|
||||
using Pilz.Plugins.Advanced;
|
||||
|
||||
namespace ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
||||
|
||||
public class MainApiParameters(IMainApi api) : PluginFunctionParameter
|
||||
{
|
||||
public IMainApi Api { get; } = api;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
using Pilz.Plugins.Advanced;
|
||||
|
||||
namespace ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
||||
|
||||
public class WorkspaceInitParameters : PluginFunctionParameter
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user