Esempio n. 1
0
        public Environment(string luaToRun, ExtensionCollection extensionCollection)
        {
            var lua           = new Lua();
            var taskExtension = new TaskExtension();

            taskExtension.LoadExtension(lua);
            extensionCollection.LoadExtensions(lua);

            lua.DoString(luaToRun);

            var tasks = lua["Pipeline"];

            if (tasks is null)
            {
                throw new PipelineNotFoundException();
            }

            if (tasks.GetType() != typeof(LuaTable))
            {
                return;
            }

            _statusUpdater = new StatusUpdater();
            _rootTaskGroup = new TaskGroup((LuaTable)tasks);
            _rootTaskGroup.Allow(_statusUpdater);
            _statusUpdater.StatusUpdate += update => Update?.Invoke(update);
        }
Esempio n. 2
0
 public Pipeline(ExtensionCollection extensionCollection)
 {
     _extensionCollection = extensionCollection;
 }