public static void NotifyManagedConsoleCommand(string command, int noArguments, ConsoleCommandArgumentsHolder argumentsHolder) { if (argumentsHolder != null) { ManagedConsoleCommandFunctionDelegate commandDelegate = m_commandsAndDelegates[command]; commandDelegate(argumentsHolder.GetAllArguments()); } }
public static bool RegisterManagedConsoleCommandFunction(string command, uint nFlags, string commandHelp, ManagedConsoleCommandFunctionDelegate managedConsoleCmdDelegate) { bool ret = false; //check if current console command exist if (!m_commandsAndDelegates.ContainsKey(command)) { m_commandsAndDelegates.Add(command, managedConsoleCmdDelegate); CryEngine.NativeInternals.IConsole.AddConsoleCommandFunction(System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(myDelegate), command, nFlags, commandHelp, true); ret = true; } return(ret); }