public bool RegisterFunction(string functionName) { GameConsoleFunction functions = this.GetGameConsoleFunctions(functionName); if (!functions.AddMethods()) { throw new Exception("No function \"" + functions + "\" found."); } return(true); }
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); }
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); }