/// <summary> /// Unbinds the ConsoleCommandHandler for the specified command /// </summary> /// <param name="command">The command for which to unbind the current /// command handler</param> /// <returns>The command handler previously bound to the specified command, /// or null if no handler was bound</returns> public ConsoleCommandHandler UnbindCommandHandler(string command) { if (!mCommandHandlers.ContainsKey(command)) { return(null); } ConsoleCommandHandlerInfo info = mCommandHandlers[command]; mCommandHandlers.Remove(command); return(info.Handler); }
/// <summary> /// Binds a ConsoleCommandHandler to the specified command /// </summary> /// <param name="command">The command to which the command handler will be bound</param> /// <param name="handler">The command handler to bind to the specified command</param> /// <param name="argumentSeparators">The characters with which the command argument string will /// be split into separate arguments</param> public void BindCommandHandler(string command, ConsoleCommandHandler handler, params char[] argumentSeparators) { mCommandHandlers[command] = new ConsoleCommandHandlerInfo(handler, argumentSeparators); }