#pragma once
#include <future>
#include <utility>
#include "renderive/scene/base/Scene_Base.hpp"
template <class... Owners>
void attach_initial(Scene_Base& scene, const Owners&... owners) {
    auto builder = scene.attach_builder();
    (builder.attach(owners), ...);
}
template <class Edit>
void with_attach_builder(Scene_Base& scene, Edit&& edit) {
    auto builder = scene.attach_builder();
    edit(builder);
}
template <class Edit>
void wait_renderable_edit(Scene_Base& scene, Edit&& edit) {
    std::promise<void> completed;
    auto future = completed.get_future();
    scene.edit_renderables([edit = std::forward<Edit>(edit), &completed](Scene_Base::Renderable_Editor& editor) mutable {
        edit(editor);
        completed.set_value();
    });
    future.wait();
}
