Example #1
0
        public bool RegisterFunction(string functionName)
        {
            GameConsoleFunction functions = this.GetGameConsoleFunctions(functionName);

            if (!functions.AddMethods())
            {
                throw new Exception("No function \"" + functions + "\" found.");
            }
            return(true);
        }
Example #2
0
        public bool RegisterFunction(string functionName, Type[] parameterTypes)
        {
            GameConsoleFunction functions = this.GetGameConsoleFunctions(functionName);

            if (!functions.AddMethod(parameterTypes))
            {
                throw new Exception("No function \"" + functions + "\" with specified parameter-types found.");
            }
            return(true);
        }
Example #3
0
        private GameConsoleFunction GetGameConsoleFunctions(string functionName)
        {
            GameConsoleFunction consoleFunction = null;

            // create new hashtable entry, if not yet included
            if (functions.ContainsKey(functionName))
            {
                consoleFunction = functions[functionName] as GameConsoleFunction;
            }
            else
            {
                consoleFunction = new GameConsoleFunction(this, functionName);
                functions.Add(functionName, consoleFunction);
            }

            return(consoleFunction);
        }