aboutsummaryrefslogtreecommitdiff
path: root/azalea-brigadier/src/context/command_context_builder.rs
diff options
context:
space:
mode:
authorUbuntu <github@matdoes.dev>2022-01-12 00:40:43 +0000
committerUbuntu <github@matdoes.dev>2022-01-12 00:40:43 +0000
commit270507736af57aae6801dc9eb3c3132139d0d07b (patch)
treea8fa1d1b8d038eb9d7e2061342026d23ddbd9027 /azalea-brigadier/src/context/command_context_builder.rs
parentcc4fe62fc82842e0bde628437a45d55c6a82f1f3 (diff)
downloadazalea-drasl-270507736af57aae6801dc9eb3c3132139d0d07b.tar.xz
a
Diffstat (limited to 'azalea-brigadier/src/context/command_context_builder.rs')
-rw-r--r--azalea-brigadier/src/context/command_context_builder.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/azalea-brigadier/src/context/command_context_builder.rs b/azalea-brigadier/src/context/command_context_builder.rs
index 88e26343..639a97ee 100644
--- a/azalea-brigadier/src/context/command_context_builder.rs
+++ b/azalea-brigadier/src/context/command_context_builder.rs
@@ -1,8 +1,10 @@
use std::collections::HashMap;
use crate::{
- arguments::argument_type::ArgumentType, command::Command,
- command_dispatcher::CommandDispatcher, redirect_modifier::RedirectModifier,
+ arguments::argument_type::{ArgumentType, Types},
+ command::Command,
+ command_dispatcher::CommandDispatcher,
+ redirect_modifier::RedirectModifier,
tree::command_node::CommandNode,
};
@@ -25,7 +27,10 @@ use super::{
// private boolean forks;
#[derive(Clone)]
-pub struct CommandContextBuilder<'a, S, T> {
+pub struct CommandContextBuilder<'a, S, T>
+where
+ T: ArgumentType<dyn Types>,
+{
arguments: HashMap<String, ParsedArgument<T>>,
root_node: &'a dyn CommandNode<S, T>,
nodes: Vec<ParsedCommandNode<S, T>>,
@@ -45,7 +50,10 @@ pub struct CommandContextBuilder<'a, S, T> {
// this.range = StringRange.at(start);
// }
-impl<S, T> CommandContextBuilder<'_, S, T> {
+impl<S, T> CommandContextBuilder<'_, S, T>
+where
+ T: ArgumentType<dyn Types>,
+{
pub fn new(
dispatcher: CommandDispatcher<S, T>,
source: S,