示例#1
0
        public void PrintConCommandDescription(ConCommand cmd)
        {
            if (cmd == null)
            {
                return;
            }
            string print = cmd.Name + ": " + cmd.Description;

            if (cmd.NumArgs > 0)
            {
                print += " ( ";
                int i = 0;
                foreach (var arg in cmd.Arguments.Value)
                {
                    if (i++ > 0)
                    {
                        print += ", ";
                    }
                    string type = arg.CommandType.ToString().Replace("System.", "");
                    if (arg.Optional)
                    {
                        print += "[" + type + " " + arg.Name + " = " + arg.DefaultVal + "]";
                    }
                    else
                    {
                        print += type + " " + arg.Name;
                    }
                }
                print += " )";
            }
            Log(print);
        }
示例#2
0
 public static void AddConCommand(ConCommand c)
 {
     if (IsConCommand(c.Name))
     {
         return;
     }
     Commands.Add(c);
 }