diff --git a/azalea-brigadier/src/arguments/argument_type.rs b/azalea-brigadier/src/arguments/argument_type.rs index ea453a1a..f5ca457b 100644 --- a/azalea-brigadier/src/arguments/argument_type.rs +++ b/azalea-brigadier/src/arguments/argument_type.rs @@ -1,3 +1,4 @@ +use super::bool_argument_type::BoolArgumentType; use crate::{ context::command_context::CommandContext, exceptions::command_syntax_exception::CommandSyntaxException, @@ -5,12 +6,27 @@ use crate::{ suggestion::{suggestions::Suggestions, suggestions_builder::SuggestionsBuilder}, }; -pub trait ArgumentResult {} +pub enum DefaultArguments { + Bool(BoolArgumentType), +} -pub trait ArgumentType -where - T: ArgumentResult, -{ +/* +define_arguments! { + Entity(EntityArgumentType) +} + +=== + +enum CustomArguments { + Entity(EntityArgumentType) +} +enum BrigadierArguments { + BuiltIn(DefaultArguments) + Custom(CustomArguments) +} +*/ + +pub trait ArgumentType { // T parse(StringReader reader) throws CommandSyntaxException; // default CompletableFuture listSuggestions(final CommandContext context, final SuggestionsBuilder builder) { diff --git a/azalea-brigadier/src/arguments/bool_argument_type.rs b/azalea-brigadier/src/arguments/bool_argument_type.rs index 74df3331..9bdf42e5 100644 --- a/azalea-brigadier/src/arguments/bool_argument_type.rs +++ b/azalea-brigadier/src/arguments/bool_argument_type.rs @@ -2,7 +2,7 @@ use crate::context::command_context::CommandContext; use super::argument_type::ArgumentType; -struct BoolArgumentType {} +pub struct BoolArgumentType {} impl ArgumentType for BoolArgumentType {} diff --git a/azalea-brigadier/src/context/command_context_builder.rs b/azalea-brigadier/src/context/command_context_builder.rs index ac4a36bb..5766ea9a 100644 --- a/azalea-brigadier/src/context/command_context_builder.rs +++ b/azalea-brigadier/src/context/command_context_builder.rs @@ -1,10 +1,8 @@ use std::collections::HashMap; use crate::{ - arguments::argument_type::{ArgumentResult, ArgumentType}, - command::Command, - command_dispatcher::CommandDispatcher, - redirect_modifier::RedirectModifier, + arguments::argument_type::ArgumentType, command::Command, + command_dispatcher::CommandDispatcher, redirect_modifier::RedirectModifier, tree::command_node::CommandNode, }; diff --git a/azalea-brigadier/src/tree/command_node.rs b/azalea-brigadier/src/tree/command_node.rs index 717ea5f1..0d9212aa 100644 --- a/azalea-brigadier/src/tree/command_node.rs +++ b/azalea-brigadier/src/tree/command_node.rs @@ -16,7 +16,7 @@ use super::{argument_command_node::ArgumentCommandNode, literal_command_node::Li pub struct BaseCommandNode { children: HashMap>, literals: HashMap>, - arguments: HashMap>>, + arguments: HashMap>>, requirement: Option bool>, redirect: Option>, modifier: Option>,