= !CommandEvaluation = == Description == A !CommandEvaluation is returned by [wiki:CommandExecutor#evaluate CommandExecutor::evaluate(string)]. A !CommandEvaluation is a container, storing a parsed [wiki:ConsoleCommand]. It's in fact just a function-pointer and a set of prepared arguments. This allows very efficient calls of the parsed command which is important if the same command gets called over and over (for example if it's [wiki:KeyBinder bound] to a key). == Usage == * '''execute()''': See [wiki:CommandExecutor#execute CommandExecutor::execute(string)] * '''complete()''': See [wiki:CommandExecutor#complete CommandExecutor::complete(string)] * '''hint()''': See [wiki:CommandExecutor#hint CommandExecutor::hint(string)] * '''getOriginalCommand()''': Returns the original command string as it was typed by the user * '''getCommand()''': Returns the final command string, modified by the [wiki:CommandExecutor] * '''isValid()''': Returns true if the command exists and all needed arguments are given * '''getConsoleCommand()''': Returns a pointer to the parsed [wiki:ConsoleCommand] * '''hasReturnvalue()''': Returns true if the command returns a value * '''getReturnvalue()''': Returns the returnvalue (if any) * '''evaluateParams()''': Prepares the given arguments (by converting them to the desired types) * '''setEvaluatedParameter('''''param-index (0-4), value''''')''': Changes an already evaluated parameter (''value'' is a [wiki:MultiType] so you can assign everything, but the exact type is better for performance) * '''getEvaluatedParameter('''''param-index (0-4)''''')''': Returns an evaluated parameter * '''setAdditionalParameter('''''parameter''''')''': Adds additional parameters (as a string). '''Warning''': This destroys the evaluation of the parameters! * '''getAdditionalParameter()''': Returns the additional parameters (if any) == Example == {{{ // Get the evaluation: CommandEvaluation myevaluation = \ CommandExecutor::evaluate("MyClass myfunction 10"); // Call MyClass::myfunction(10) a hundred times: for (int i = 0; i < 100; i++) myevaluation.execute(); // Change the evaluated parameter from 10 to 33: myevaluation.setEvaluatedParameter(33); // Call MyClass::myfunction(33) once: myevaluation.execute(); }}}