/// <summary> /// Handles the command in the console inputString. Prints if the command is valid or not /// Also appends the command to the console buffer, wrong or not. /// </summary> public void HandleLogInputCommand(string commandString) { if (commandString == "") { m_consoleView.OnEntrySubmitted(); return; } string[] split = commandString.Split(' '); string commandId = split[0]; string[] commandArgs = split.SubArray(1); AddEntryToLog(commandString, ConsoleEntryType.UserInput); var command = FindCommandThatMatchesArgs(commandId, commandArgs); if (command != null) { ConsoleEntry invokeMessage = CommandHandler.InvokeCommand(command, commandArgs, out bool argumentsWereHandled); if (invokeMessage != null) { AddEntryToLog(invokeMessage.Description, invokeMessage.EntryType); } } else { AddEntryToLog("No command matches the given signature", ConsoleEntryType.Error); } m_consoleView.OnEntrySubmitted(); }