aboutsummaryrefslogtreecommitdiff
path: root/azalea-brigadier/src/command_dispatcher.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-04-17 14:02:13 -0500
committermat <github@matdoes.dev>2022-04-17 14:02:13 -0500
commita72a47ced76065caf739898954cd18edbc39174b (patch)
tree5526c7663f253bbd7c8318b9d98413f1f2074852 /azalea-brigadier/src/command_dispatcher.rs
parent4ff67d4917ce333232189e86aee09f2d82451fc6 (diff)
downloadazalea-drasl-a72a47ced76065caf739898954cd18edbc39174b.tar.xz
Rewrite brigadier
Diffstat (limited to 'azalea-brigadier/src/command_dispatcher.rs')
-rw-r--r--azalea-brigadier/src/command_dispatcher.rs46
1 files changed, 0 insertions, 46 deletions
diff --git a/azalea-brigadier/src/command_dispatcher.rs b/azalea-brigadier/src/command_dispatcher.rs
deleted file mode 100644
index f8ffddff..00000000
--- a/azalea-brigadier/src/command_dispatcher.rs
+++ /dev/null
@@ -1,46 +0,0 @@
-use crate::{arguments::argument_type::ArgumentType, tree::root_command_node::RootCommandNode};
-use std::fmt::Debug;
-
-/// The core command dispatcher, for registering, parsing, and executing commands.
-/// The `S` generic is a custom "source" type, such as a user or originator of a command
-#[derive(Default, Clone)]
-pub struct CommandDispatcher<S> {
- root: RootCommandNode<S>,
-}
-
-impl<S> CommandDispatcher<S> {
- /// The string required to separate individual arguments in an input string
- ///
- /// See: [`ARGUMENT_SEPARATOR_CHAR`]
- const ARGUMENT_SEPARATOR: &'static str = " ";
-
- /// The char required to separate individual arguments in an input string
- ///
- /// See: [`ARGUMENT_SEPARATOR`]
- const ARGUMENT_SEPARATOR_CHAR: char = ' ';
-
- const USAGE_OPTIONAL_OPEN: &'static str = "[";
- const USAGE_OPTIONAL_CLOSE: &'static str = "]";
- const USAGE_REQUIRED_OPEN: &'static str = "(";
- const USAGE_REQUIRED_CLOSE: &'static str = ")";
- const USAGE_OR: &'static str = "|";
-
- /// Create a new [`CommandDispatcher`] with the specified root node.
- /// This is often useful to copy existing or pre-defined command trees.
- /// # Example
- /// ```
- /// use azalea_brigadier::{
- /// command_dispatcher::CommandDispatcher,
- /// tree::root_command_node::RootCommandNode,
- /// };
- ///
- /// let mut dispatcher = CommandDispatcher::new(RootCommandNode::new());
- /// ```
- /// # Arguments
- /// * `root` - the existing [`RootCommandNode`] to use as the basis for this tree
- /// # Returns
- /// A new [`CommandDispatcher`] with the specified root node.
- fn new(root: RootCommandNode<S>) -> Self {
- Self { root }
- }
-}