-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
126 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Obsidian.API.Events; | ||
|
||
namespace Obsidian.API.Plugins; | ||
public interface IPluginConfigurationManager | ||
{ | ||
public IPluginConfigurationManager MapCommands(); | ||
public IPluginConfigurationManager MapCommand(ContextDelegate<CommandContext> contextDelegate); | ||
|
||
public IPluginConfigurationManager MapEvent<TEventArgs>(ContextDelegate<TEventArgs> contextDelegate, Priority priority = Priority.Low) where TEventArgs : BaseMinecraftEventArgs; | ||
public IPluginConfigurationManager MapEvents(); | ||
} | ||
|
||
|
||
//TODO better name maybe?? | ||
public delegate ValueTask ContextDelegate<TContext>(TContext context); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Obsidian.API; | ||
|
||
//TODO add more | ||
public enum Priority | ||
{ | ||
Low, | ||
|
||
High | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Obsidian.API.Events; | ||
using Obsidian.Plugins; | ||
|
||
namespace Obsidian.API.Plugins; | ||
public sealed class PluginConfigurationManager(PluginManager pluginManager) : IPluginConfigurationManager | ||
{ | ||
private readonly PluginManager pluginManager = pluginManager; | ||
|
||
public IPluginConfigurationManager MapCommands() | ||
{ | ||
|
||
return this; | ||
} | ||
|
||
public IPluginConfigurationManager MapEvent<TEventArgs>(ContextDelegate<TEventArgs> contextDelegate, Priority priority = Priority.Low) where TEventArgs : BaseMinecraftEventArgs | ||
{ | ||
|
||
return this; | ||
} | ||
|
||
public IPluginConfigurationManager MapCommand(ContextDelegate<CommandContext> contextDelegate) | ||
{ | ||
|
||
|
||
return this; | ||
} | ||
|
||
public IPluginConfigurationManager MapEvents() | ||
{ | ||
|
||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters