protected virtual void LoadCommandsList() { foreach (var com in GetAPICommandClasses()) { if (com != null) { if (com.IsAbstract == false) { API_interface D = (API_interface)Activator.CreateInstance(com); if (D != null) { if (subtype_map.ContainsKey(D.CommandName) == false) { string worknamespace = com.Namespace; worknamespace = worknamespace.Replace("BSB.Commands.", ""); worknamespace = worknamespace.Replace("BSB.RLV.", ""); worknamespace = worknamespace.Replace("BetterSecondBot.HttpServer.View.", ""); worknamespace = worknamespace.Replace("BetterSecondBot.HttpServer.Control.", ""); worknamespace = worknamespace.Replace("CMD_", ""); subtype_map.Add(D.CommandName, D.GetType()); subtype_workspace_map.Add(D.CommandName, worknamespace); } else { ConsoleLog.Crit("[CMD] command: " + D.CommandName + " already defined!"); } } } } } }
public virtual int GetCommandArgs(string cmd) { API_interface cmdGet = GetCommand(cmd); if (cmdGet != null) { return(cmdGet.MinArgs); } return(0); }
public virtual string[] GetCommandArgHints(string cmd) { API_interface CmdGet = GetCommand(cmd); if (CmdGet != null) { return(CmdGet.ArgHints); } return(new string[] { }); }
public virtual string GetCommandHelp(string cmd) { API_interface cmdGet = GetCommand(cmd); if (cmdGet != null) { return(cmdGet.Helpfile); } return("None given"); }