コード例 #1
0
        public string Execute(string functionName, string[] parameters)
        {
            if (string.IsNullOrEmpty(functionName))
            {
                if (parameters.Length == 1 && parameters[0] == "-?")
                {
                    return(GetRegisteredFunctions());
                }
            }
            if (!functions.ContainsKey(functionName))
            {
                return("ERROR: function/property not registered");
            }

            IGameConsoleExternCommand item = functions[functionName] as IGameConsoleExternCommand;

            if (item != null)
            {
                return(item.Execute(parameters));
            }
            else
            {
                return("");
            }
        }
コード例 #2
0
        private string GetRegisteredFunctions()
        {
            string result = "\n";

            foreach (string key in functions.Keys)
            {
                IGameConsoleExternCommand command = functions[key] as IGameConsoleExternCommand;
                result += command.Info + "\n";
            }
            return(result);
        }