/// <summary> /// Executes a command script. /// Returns the determined value(s). /// </summary> /// <param name="script">The script to execute.</param> /// <param name="Variables">What variables to add to the commandqueue.</param> /// <param name="queue">Outputs the generated queue (already ran or running).</param> public List<string> ExecuteScript(CommandScript script, Dictionary<string, TemplateObject> Variables, out CommandQueue queue) { queue = script.ToQueue(this); if (Variables != null) { foreach (KeyValuePair<string, TemplateObject> variable in Variables) { queue.SetVariable(variable.Key, variable.Value); } } queue.Execute(); return queue.Determinations; }
/// <summary> /// Constructs a new CommandQueue - generally kept to the Frenetic internals. /// TODO: IList _commands -> ListQueue? /// </summary> public CommandQueue(CommandScript _script, IList<CommandEntry> _commands, Commands _system) { Script = _script; CommandList = new ListQueue<CommandEntry>(_commands); CommandSystem = _system; Variables = new Dictionary<string, TemplateObject>(); Debug = DebugMode.FULL; }