From 45c66ca7db1581793dd95b4e7f2dd037ce27c852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20St=C4=99pie=C5=84?= Date: Sat, 22 Aug 2026 22:22:32 +0200 Subject: [PATCH] chore: merge CommandArgType into CommandArgSpec --- .../Console/Application/Commands/ClearCommand.cs | 2 +- .../Console/Application/Commands/HelpCommand.cs | 2 +- src/Features/Console/Contracts/CommandArgSpec.cs | 9 +++++++++ src/Features/Console/Contracts/CommandArgType.cs | 10 ---------- src/Features/Console/Contracts/CommandArgType.cs.uid | 1 - 5 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 src/Features/Console/Contracts/CommandArgType.cs delete mode 100644 src/Features/Console/Contracts/CommandArgType.cs.uid diff --git a/src/Features/Console/Application/Commands/ClearCommand.cs b/src/Features/Console/Application/Commands/ClearCommand.cs index a2d065a..c8f228d 100644 --- a/src/Features/Console/Application/Commands/ClearCommand.cs +++ b/src/Features/Console/Application/Commands/ClearCommand.cs @@ -7,7 +7,7 @@ public sealed class ClearCommand : ICommand { public string Name => "clear"; public string Description => "Clears the console output."; - public IReadOnlyList Args { get; } = new CommandArgsBuilder().Build(); + public IReadOnlyList Args { get; } = []; public CommandResult Execute(CommandArgValues args) => CommandResult.Ok(clearOutput: true); } diff --git a/src/Features/Console/Application/Commands/HelpCommand.cs b/src/Features/Console/Application/Commands/HelpCommand.cs index 3bf9a24..4cc8c8b 100644 --- a/src/Features/Console/Application/Commands/HelpCommand.cs +++ b/src/Features/Console/Application/Commands/HelpCommand.cs @@ -9,7 +9,7 @@ public sealed class HelpCommand(ICommandRegistry registry) : ICommand { public string Name => "help"; public string Description => "Lists all available commands."; - public IReadOnlyList Args { get; } = new CommandArgsBuilder().Build(); + public IReadOnlyList Args { get; } = []; private static string FormatUsage(ICommand command) { diff --git a/src/Features/Console/Contracts/CommandArgSpec.cs b/src/Features/Console/Contracts/CommandArgSpec.cs index 9d92b22..c2315ac 100644 --- a/src/Features/Console/Contracts/CommandArgSpec.cs +++ b/src/Features/Console/Contracts/CommandArgSpec.cs @@ -2,6 +2,15 @@ using System.Collections.Generic; namespace Game.Features.Console.Contracts; +public enum CommandArgType +{ + String, + Int, + Float, + Bool, + Choice +} + public sealed record CommandArgSpec(string Name, CommandArgType Type, IReadOnlyList Choices = null) { public override string ToString() => diff --git a/src/Features/Console/Contracts/CommandArgType.cs b/src/Features/Console/Contracts/CommandArgType.cs deleted file mode 100644 index a8229d9..0000000 --- a/src/Features/Console/Contracts/CommandArgType.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Game.Features.Console.Contracts; - -public enum CommandArgType -{ - String, - Int, - Float, - Bool, - Choice -} diff --git a/src/Features/Console/Contracts/CommandArgType.cs.uid b/src/Features/Console/Contracts/CommandArgType.cs.uid deleted file mode 100644 index 41ef40b..0000000 --- a/src/Features/Console/Contracts/CommandArgType.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dnt7hwlwqtdyq