示例#1
0
        public static void AddConCommandArgsMinMax(string name, string description, Action<string[]> lambda, int minArguments, int maxArguments, long flags = 0)
        {
            if (IsCommand(name)) return;

            ConCommand cc = new ConCommand(lambda, description, name, flags);
            cc.SetArgNumMinMax(minArguments, maxArguments);
            Commands.Add(cc);
        }
示例#2
0
        public static void AddConCommandArgsMult(string name, string description, Action<string[]> lambda, int[] argumentNums, long flags = 0)
        {
            if (IsCommand(name)) return;

            ConCommand cc = new ConCommand(lambda, description, name, flags);
            cc.SetArgNumMultiple(argumentNums);
            Commands.Add(cc);
        }
示例#3
0
 public static void AddConCommand(string name, string description, Action lambda, long flags = 0)
 {
     if (IsCommand(name)) return;
     //Using ConCommand for both argument and no argument concommands,
     //So it expects an Action<string>. So we just make a new Action that calls the passed in Action.
     //HOORAY!
     ConCommand cc = new ConCommand(l => lambda(), description, name, flags);
     Commands.Add(cc);
 }