コード例 #1
0
 public void AddCommands(CmdGroupInitializer newCommands)
 {
     for (int n = 0; n < newCommands.Count; n++)
     {
         var cmd = newCommands[n];
         TryAdd(cmd.Item1, cmd.Item2, cmd.Item3);
     }
 }
コード例 #2
0
        public static ICommandGroup GetOrCreateGroup(string prefix, CmdGroupInitializer groupInitializer = null)
        {
            prefix = prefix.ToLower();
            CommandGroup group = instance.commandGroups.Find(x => x.Prefix == prefix);

            if (group == null)
            {
                group = new CommandGroup(prefix);
                instance.commandGroups.Add(group);
                group.AddCommands(groupInitializer);
            }

            return(group);
        }