refactor: split hook delegate into before and after with result

This commit is contained in:
2026-06-04 22:04:19 +02:00
parent 7cdd8d27c0
commit ecf9925645
3 changed files with 9 additions and 6 deletions
+6
View File
@@ -0,0 +1,6 @@
using Vintagestory.API.Common;
namespace CommandHook;
public delegate void CommandBeforeDelegate(ref CommandData data);
public delegate void CommandAfterDelegate(ref CommandData data, TextCommandResult result);
-3
View File
@@ -1,3 +0,0 @@
namespace CommandHook;
public delegate void CommandHookDelegate(ref CommandData data);
+3 -3
View File
@@ -2,10 +2,10 @@ namespace CommandHook;
public struct CommandRegistration
{
public readonly CommandHookDelegate? Before;
public readonly CommandHookDelegate? After;
public readonly CommandBeforeDelegate? Before;
public readonly CommandAfterDelegate? After;
public CommandRegistration(CommandHookDelegate? before, CommandHookDelegate? after)
public CommandRegistration(CommandBeforeDelegate? before, CommandAfterDelegate? after)
{
Before = before;
After = after;