コード例 #1
0
 public CommandContextBuilder <TSource> WithNode(CommandNode <TSource> node, StringRange range)
 {
     Nodes.Add(new ParsedCommandNode <TSource>(node, range));
     Range     = StringRange.Encompassing(Range, range);
     _modifier = node.RedirectModifier;
     _forks    = node.IsFork;
     return(this);
 }
コード例 #2
0
 public CommandContextBuilder(CommandDispatcher <TSource> dispatcher, TSource source, CommandNode <TSource> rootNode, StringRange range, IDictionary <string, IParsedArgument> arguments, List <ParsedCommandNode <TSource> > nodes)
 {
     Dispatcher = dispatcher;
     Source     = source;
     RootNode   = rootNode;
     Range      = range;
     _arguments = new Dictionary <string, IParsedArgument>(arguments);
     Nodes      = new List <ParsedCommandNode <TSource> >(nodes);
 }
コード例 #3
0
 public CommandContextBuilder(CommandDispatcher <TSource> dispatcher, TSource source, CommandNode <TSource> rootNode, int start)
 {
     RootNode   = rootNode;
     Dispatcher = dispatcher;
     Source     = source;
     Range      = StringRange.At(start);
     _arguments = new Dictionary <string, IParsedArgument>();
     Nodes      = new List <ParsedCommandNode <TSource> >();
 }
コード例 #4
0
 public CommandContext(TSource source, string input, IDictionary <string, IParsedArgument> arguments, Command <TSource> command, CommandNode <TSource> rootNode, List <ParsedCommandNode <TSource> > nodes, StringRange range, CommandContext <TSource> child, RedirectModifier <TSource> modifier, bool forks)
 {
     Source           = source;
     Input            = input;
     _arguments       = arguments;
     Command          = command;
     RootNode         = rootNode;
     Nodes            = nodes;
     Range            = range;
     Child            = child;
     RedirectModifier = modifier;
     _forks           = forks;
 }
コード例 #5
0
 public ParsedArgument(int start, int end, T result)
 {
     Range   = StringRange.Between(start, end);
     _result = result;
 }
コード例 #6
0
ファイル: StringRange.cs プロジェクト: dpeter99/Brigadier.NET
 public static StringRange Encompassing(StringRange a, StringRange b)
 {
     return(new StringRange(Math.Min(a.Start, b.Start), Math.Max(a.End, b.End)));
 }
コード例 #7
0
 public ParsedCommandNode(CommandNode <TSource> node, StringRange range)
 {
     Node  = node;
     Range = range;
 }
コード例 #8
0
 public bool Equals(StringRange other)
 {
     return(Equals(Start, other.Start) && Equals(End, other.End));
 }